mirror of
https://github.com/apache/struts.git
synced 2026-08-09 08:36:54 +00:00
Compare commits
86 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| de154978ca | |||
| e3a6004b6d | |||
| 1e769cc3b3 | |||
| 299579aef2 | |||
| 85c9e4c171 | |||
| 6d3cceca00 | |||
| 2154ad8513 | |||
| fa754949ab | |||
| 9d71021b14 | |||
| b6be295074 | |||
| 13e6ae21d4 | |||
| 1e73567cec | |||
| 8fa480d66b | |||
| 8910d90721 | |||
| db2bf7b4e3 | |||
| 77cb215263 | |||
| 51d985b3b7 | |||
| 3563fe21e7 | |||
| 8f589c03db | |||
| bb8d0bf28a | |||
| 09f11dac5c | |||
| fbe7fe226f | |||
| 4e78cfce78 | |||
| 004ab6c47c | |||
| ff7144ca42 | |||
| ae053fb669 | |||
| f621683dc1 | |||
| 209965eff0 | |||
| 0a64f616e8 | |||
| 6f97753eec | |||
| 46dd4d4ca6 | |||
| 98d4313537 | |||
| 231e27fd5e | |||
| 08f5faf1af | |||
| 1be016ae02 | |||
| 0a6c72e0c7 | |||
| dceee365c0 | |||
| eca621ef35 | |||
| fdcfcb8c15 | |||
| 422c84f511 | |||
| 16939ed8b1 | |||
| b39e1f24c2 | |||
| a1e9ba6aa4 | |||
| 7da5f114b4 | |||
| 4fd5d2ab15 | |||
| fe3d2c2228 | |||
| e75a5ae946 | |||
| a4e91a9581 | |||
| 5c1593c02e | |||
| 28a98b5757 | |||
| df14a287d0 | |||
| 60391db64f | |||
| 6692879894 | |||
| 9452a5c591 | |||
| a181296a17 | |||
| 94d7466015 | |||
| c6c51c6ba4 | |||
| f13243a2bf | |||
| b2496a566c | |||
| 756c2f58d5 | |||
| cac778c170 | |||
| 66479bc36e | |||
| e023f033af | |||
| 8199b1a3b7 | |||
| d078084107 | |||
| c990786a59 | |||
| 3f7dd2ef82 | |||
| 7d8dfff8a1 | |||
| 129e4559ce | |||
| ff9bfe3bd4 | |||
| e163098224 | |||
| dd200c173c | |||
| d7189a6648 | |||
| 2cab82fafc | |||
| 1472a49a0f | |||
| 5e3464d467 | |||
| d60e674046 | |||
| 6e81a692b7 | |||
| fbedbdedbe | |||
| 1a2bd58e65 | |||
| 421ff8d068 | |||
| 0e7dbe0b62 | |||
| ae4e489d9e | |||
| dcc79d485d | |||
| 75b379d5d4 | |||
| cb580fe614 |
-76
@@ -1,76 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Struts 2 API</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/api/</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/api/</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/api/</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
<!-- has to be compile for StrutsTestCase, which is part of the base package so others can write unit tests -->
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.easymock</groupId>
|
||||
<artifactId>easymock</artifactId>
|
||||
<scope>test</scope>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<configuration>
|
||||
<showPackage>false</showPackage>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2;
|
||||
|
||||
/**
|
||||
* Default action interface. Provided purely for user convenience. Struts does not require actions to implement any
|
||||
* interfaces. Actions need only implement a public, no argument method which returns {@code String}. If a user does
|
||||
* not specify a method name, Struts defaults to {@code execute()}.
|
||||
*
|
||||
* <p>For example:
|
||||
*
|
||||
* <pre>
|
||||
* static import ResultNames.*;
|
||||
*
|
||||
* public class MyAction <b>implements Action</b> {
|
||||
*
|
||||
* public String execute() {
|
||||
* return SUCCESS;
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* <p>is equivalent to:
|
||||
*
|
||||
* <pre>
|
||||
* static import ResultNames.*;
|
||||
*
|
||||
* public class MyAction {
|
||||
*
|
||||
* public String execute() {
|
||||
* return SUCCESS;
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @author crazybob@google.com (Bob Lee)
|
||||
*/
|
||||
public interface Action {
|
||||
|
||||
/**
|
||||
* Executes this action.
|
||||
*
|
||||
* @return result name which matches a result name from the action mapping in the configuration file. See {@link
|
||||
* ResultNames} for common suggestions.
|
||||
*/
|
||||
String execute();
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2;
|
||||
|
||||
/**
|
||||
* Implemented by actions which may need to record errors or messages.
|
||||
*
|
||||
* <pre>
|
||||
* static import ResultNames.*;
|
||||
*
|
||||
* public class SetName implements MessageAware {
|
||||
*
|
||||
* Messages messages;
|
||||
* String name;
|
||||
*
|
||||
* public String execute() {
|
||||
* return SUCCESS;
|
||||
* }
|
||||
*
|
||||
* public void setName(String name) {
|
||||
* if ("".equals(name))
|
||||
* messages.forField("name").addError("name.required");
|
||||
*
|
||||
* this.name = name;
|
||||
* }
|
||||
*
|
||||
* public void setMessages(Messages messages) {
|
||||
* this.messages = messages;
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @author crazybob@google.com (Bob Lee)
|
||||
*/
|
||||
public interface MessageAware {
|
||||
|
||||
/**
|
||||
* Sets messages.
|
||||
*
|
||||
* @param messages messages
|
||||
*/
|
||||
void setMessages(Messages messages);
|
||||
}
|
||||
@@ -1,216 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Collection of messages. Supports nesting messages by field name.
|
||||
*
|
||||
* <p>Uses keys when adding instead of actual messages to decouple code from messages.
|
||||
*
|
||||
* @author crazybob@google.com (Bob Lee)
|
||||
*/
|
||||
public interface Messages {
|
||||
|
||||
// TODO: Use Object[] for args instead of String[].
|
||||
|
||||
/**
|
||||
* Message severity.
|
||||
*/
|
||||
public enum Severity {
|
||||
|
||||
/**
|
||||
* Informational messages.
|
||||
*/
|
||||
INFO,
|
||||
|
||||
/**
|
||||
* Warning messages.
|
||||
*/
|
||||
WARN,
|
||||
|
||||
/**
|
||||
* Error messages.
|
||||
*/
|
||||
ERROR,
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets nested messages for the given field.
|
||||
*
|
||||
* <p>Supports dot notation to represent nesting. For example:
|
||||
*
|
||||
* <pre>
|
||||
* messages.forField("foo").forField("bar") == messages.forField("foo.bar")
|
||||
* </pre>
|
||||
*
|
||||
* @param fieldName name of the field
|
||||
* @return nested {@code Messages} for given field name
|
||||
*/
|
||||
Messages forField(String fieldName);
|
||||
|
||||
/**
|
||||
* Gets map of field name to messages for that field.
|
||||
*
|
||||
* @return map of field name to {@code Messages}
|
||||
*/
|
||||
Map<String, Messages> forFields();
|
||||
|
||||
/**
|
||||
* Adds informational message.
|
||||
*
|
||||
* @param key message key
|
||||
* @see Severity.INFO
|
||||
*/
|
||||
void addInformation(String key);
|
||||
|
||||
/**
|
||||
* Adds informational message.
|
||||
*
|
||||
* @param key message key
|
||||
* @param arguments message arguments
|
||||
* @see Severity.INFO
|
||||
*/
|
||||
void addInformation(String key, String... arguments);
|
||||
|
||||
/**
|
||||
* Adds warning message.
|
||||
*
|
||||
* @param key message key
|
||||
* @see Severity.WARN
|
||||
*/
|
||||
void addWarning(String key);
|
||||
|
||||
/**
|
||||
* Adds warning message.
|
||||
*
|
||||
* @param key message key
|
||||
* @param arguments message arguments
|
||||
* @see Severity.WARN
|
||||
*/
|
||||
void addWarning(String key, String... arguments);
|
||||
|
||||
/**
|
||||
* Adds error message.
|
||||
*
|
||||
* @param key message key
|
||||
* @see Severity.ERROR
|
||||
*/
|
||||
void addError(String key);
|
||||
|
||||
/**
|
||||
* Adds error message.
|
||||
*
|
||||
* @param key message key
|
||||
* @param arguments message arguments
|
||||
* @see Severity.ERROR
|
||||
*/
|
||||
void addError(String key, String... arguments);
|
||||
|
||||
/**
|
||||
* Adds message.
|
||||
*
|
||||
* @param severity message severity
|
||||
* @param key message key
|
||||
*/
|
||||
void add(Severity severity, String key);
|
||||
|
||||
/**
|
||||
* Adds request-scoped message.
|
||||
*
|
||||
* @param severity message severity
|
||||
* @param key message key
|
||||
* @param arguments message arguments
|
||||
*/
|
||||
void add(Severity severity, String key, String... arguments);
|
||||
|
||||
/**
|
||||
* Gets set of severities for which this {@code Messages} instance has messages. Not recursive.
|
||||
*
|
||||
* @return unmodifiable set of {@link Severity} sorted from least to most severe
|
||||
*/
|
||||
Set<Severity> getSeverities();
|
||||
|
||||
/**
|
||||
* Gets message strings for the given severity. Not recursive.
|
||||
*
|
||||
* @param severity message severity
|
||||
* @return unmodifiable list of messages
|
||||
*/
|
||||
List<String> forSeverity(Severity severity);
|
||||
|
||||
/**
|
||||
* Gets error message strings for this {@code Messages} instance. Not recursive.
|
||||
*
|
||||
* @return unmodifiable list of messages
|
||||
*/
|
||||
List<String> getErrors();
|
||||
|
||||
/**
|
||||
* Gets error message strings for this {@code Messages} instance. Not recursive.
|
||||
*
|
||||
* @return unmodifiable list of messages
|
||||
*/
|
||||
List<String> getWarnings();
|
||||
|
||||
/**
|
||||
* Gets informational message strings for this {@code Messages} instance. Not recursive.
|
||||
*
|
||||
* @return unmodifiable list of messages
|
||||
*/
|
||||
List<String> getInformation();
|
||||
|
||||
/**
|
||||
* Returns true if this or a nested {@code Messages} instance has error messages.
|
||||
*
|
||||
* @see Severity.ERROR
|
||||
*/
|
||||
boolean hasErrors();
|
||||
|
||||
/**
|
||||
* Returns true if this or a nested {@code Messages} instance has warning messages.
|
||||
*
|
||||
* @see Severity.WARN
|
||||
*/
|
||||
boolean hasWarnings();
|
||||
|
||||
/**
|
||||
* Returns true if this or a nested {@code Messages} instance has informational messages.
|
||||
*
|
||||
* @see Severity.INFO
|
||||
*/
|
||||
boolean hasInformation();
|
||||
|
||||
/**
|
||||
* Returns true if this and all nested {@code Messages} instances have no messages.
|
||||
*/
|
||||
boolean isEmpty();
|
||||
|
||||
/**
|
||||
* Returns true if this and all nested {@code Messages} instances have no messages for the given severity.
|
||||
*
|
||||
* @param severity message severity
|
||||
*/
|
||||
boolean isEmpty(Severity severity);
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2;
|
||||
|
||||
/**
|
||||
* Commonly used result names returned by action methods.
|
||||
*
|
||||
* @author crazybob@google.com (Bob Lee)
|
||||
*/
|
||||
public final class ResultNames {
|
||||
|
||||
private ResultNames() {}
|
||||
|
||||
/**
|
||||
* The action executed successfully.
|
||||
*/
|
||||
public static final String SUCCESS = "success";
|
||||
|
||||
/**
|
||||
* The action requires more input, i.e. a validation error occurred.
|
||||
*/
|
||||
public static final String INPUT = "input";
|
||||
|
||||
/**
|
||||
* The action requires the user to log in before executing.
|
||||
*/
|
||||
public static final String LOGIN = "login";
|
||||
|
||||
/**
|
||||
* The action execution failed irrecoverably.
|
||||
*/
|
||||
public static final String ERROR = "error";
|
||||
|
||||
/**
|
||||
* The action executed successfully, but do not execute a result.
|
||||
*/
|
||||
public static final String NONE = "none";
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2;
|
||||
|
||||
import org.apache.struts2.MessageAware;
|
||||
|
||||
/**
|
||||
* Implemented by actions which wish to execute some validation logic before their action method. Useful for
|
||||
* cross-field validations.
|
||||
*
|
||||
* @author crazybob@google.com (Bob Lee)
|
||||
*/
|
||||
public interface Validatable extends MessageAware {
|
||||
|
||||
/**
|
||||
* Validates input. Executes before action method.
|
||||
*/
|
||||
public void validate();
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.servlet;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* Implemented by actions which need direct access to the servlet response.
|
||||
*
|
||||
* @author crazybob@google.com (Bob Lee)
|
||||
*/
|
||||
public interface ServletResponseAware {
|
||||
|
||||
/**
|
||||
* Sets the servlet response.
|
||||
*
|
||||
* @param response servlet response
|
||||
*/
|
||||
void setServletResponse(HttpServletResponse response);
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.spi;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* Context of an action execution.
|
||||
*
|
||||
* @author crazybob@google.com (Bob Lee)
|
||||
*/
|
||||
public interface ActionContext {
|
||||
|
||||
/**
|
||||
* Gets action instance.
|
||||
*/
|
||||
Object getAction();
|
||||
|
||||
/**
|
||||
* Gets action method.
|
||||
*/
|
||||
Method getMethod();
|
||||
|
||||
/**
|
||||
* Gets action name.
|
||||
*/
|
||||
String getActionName();
|
||||
|
||||
/**
|
||||
* Gets the path for the action's namespace.
|
||||
*/
|
||||
String getNamespacePath();
|
||||
|
||||
/**
|
||||
* Gets the {@link Result} instance for the action.
|
||||
*
|
||||
* @return {@link Result} instance or {@code null} if we don't have a result yet.
|
||||
*/
|
||||
Result getResult();
|
||||
|
||||
/**
|
||||
* Adds a result interceptor for the action. Enables executing code before and after a result, executing an
|
||||
* alternate result, etc.
|
||||
*/
|
||||
void addResultInterceptor(Result interceptor);
|
||||
|
||||
/**
|
||||
* Gets context of action which chained to us.
|
||||
*
|
||||
* @return context of previous action or {@code null} if this is the first action in the chain
|
||||
*/
|
||||
ActionContext getPrevious();
|
||||
|
||||
/**
|
||||
* Gets context of action which this action chained to.
|
||||
*
|
||||
* @return context of next action or {@code null} if we haven't chained to another action yet or this is the last
|
||||
* action in the chain.
|
||||
*/
|
||||
ActionContext getNext();
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.spi;
|
||||
|
||||
/**
|
||||
* Intercepts an action request.
|
||||
*
|
||||
* @author crazybob@google.com (Bob Lee)
|
||||
*/
|
||||
public interface Interceptor {
|
||||
|
||||
/**
|
||||
* Intercepts an action request.
|
||||
*
|
||||
* @param requestContext current request context
|
||||
*/
|
||||
String intercept(RequestContext requestContext) throws Exception;
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.spi;
|
||||
|
||||
import org.apache.struts2.Messages;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Request context. A single request may span multiple actions with action chaining.
|
||||
*
|
||||
* @author crazybob@google.com (Bob Lee)
|
||||
*/
|
||||
public interface RequestContext {
|
||||
|
||||
/**
|
||||
* Gets context of the currently executing action.
|
||||
*
|
||||
* @return current action context
|
||||
*/
|
||||
ActionContext getActionContext();
|
||||
|
||||
/**
|
||||
* Convenience method. Equivalent to {@code getActionContext().getAction()}.
|
||||
*
|
||||
* @return currently executing action
|
||||
*/
|
||||
Object getAction();
|
||||
|
||||
/**
|
||||
* Gets map of request parameters.
|
||||
*/
|
||||
Map<String, String[]> getParameterMap();
|
||||
|
||||
/**
|
||||
* Gets map of request attributes.
|
||||
*/
|
||||
Map<String, Object> getAttributeMap();
|
||||
|
||||
/**
|
||||
* Gets map of session attributes.
|
||||
*/
|
||||
Map<String, Object> getSessionMap();
|
||||
|
||||
/**
|
||||
* Gets map of application (servlet context) attributes.
|
||||
*/
|
||||
Map<String, Object> getApplicationMap();
|
||||
|
||||
/**
|
||||
* Finds cookies with the given name,
|
||||
*/
|
||||
List<Cookie> findCookiesForName(String name);
|
||||
|
||||
/**
|
||||
* Gets locale.
|
||||
*/
|
||||
Locale getLocale();
|
||||
|
||||
/**
|
||||
* Sets locale. Stores the locale in the session for future requests.
|
||||
*/
|
||||
void setLocale(Locale locale);
|
||||
|
||||
/**
|
||||
* Gets messages.
|
||||
*/
|
||||
Messages getMessages();
|
||||
|
||||
/**
|
||||
* Gets the servlet request.
|
||||
*/
|
||||
HttpServletRequest getServletRequest();
|
||||
|
||||
/**
|
||||
* Gets the servlet response.
|
||||
*/
|
||||
HttpServletResponse getServletResponse();
|
||||
|
||||
/**
|
||||
* Gets the servlet context.
|
||||
*/
|
||||
ServletContext getServletContext();
|
||||
|
||||
/**
|
||||
* Gets the value stack.
|
||||
*/
|
||||
ValueStack getValueStack();
|
||||
|
||||
/**
|
||||
* Invokes the next interceptor or the action method if no more interceptors remain.
|
||||
*
|
||||
* @return result name
|
||||
* @throws IllegalStateException if already invoked or called from the action
|
||||
*/
|
||||
String proceed() throws Exception;
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.spi;
|
||||
|
||||
import org.apache.struts2.spi.RequestContext;
|
||||
|
||||
/**
|
||||
* Implemented by actions that need access to the current {@link org.apache.struts2.spi.RequestContext}. Use
|
||||
* judiciously.
|
||||
*
|
||||
* @author crazybob@google.com (Bob Lee)
|
||||
*/
|
||||
public interface RequestContextAware {
|
||||
|
||||
/**
|
||||
* Sets {@link org.apache.struts2.spi.RequestContext}.
|
||||
*
|
||||
* @param requestContext
|
||||
*/
|
||||
void setRequestContext(RequestContext requestContext);
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.spi;
|
||||
|
||||
import org.apache.struts2.spi.RequestContext;
|
||||
|
||||
/**
|
||||
* The result of an action request. Struts creates a new {@code Result} instance for each request.
|
||||
*
|
||||
* @author crazybob@google.com (Bob Lee)
|
||||
*/
|
||||
public interface Result {
|
||||
|
||||
/**
|
||||
* Executes result.
|
||||
*
|
||||
* @param requestContext
|
||||
*/
|
||||
void execute(RequestContext requestContext) throws Exception;
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.spi;
|
||||
|
||||
/**
|
||||
* A central fixture of the Struts framework, the {@code ValueStack} is a stack which contains the actions
|
||||
* which have executed in addition to other objects. Users can get and set values on the stack using expressions. The
|
||||
* {@code ValueStack} will search down the stack starting with the most recent objects until it finds an object to
|
||||
* which the expression can apply.
|
||||
*
|
||||
* @author crazybob@google.com (Bob Lee)
|
||||
*/
|
||||
public interface ValueStack extends Iterable<Object> {
|
||||
|
||||
/**
|
||||
* Gets the top, most recent object from the stack without changing the stack.
|
||||
*
|
||||
* @return the top object
|
||||
*/
|
||||
Object peek();
|
||||
|
||||
/**
|
||||
* Removes the top, most recent object from the stack.
|
||||
*
|
||||
* @return the top object
|
||||
*/
|
||||
Object pop();
|
||||
|
||||
/**
|
||||
* Pushes an object onto the stack.
|
||||
*
|
||||
* @param o
|
||||
*/
|
||||
void push(Object o);
|
||||
|
||||
/**
|
||||
* Creates a shallow copy of this stack.
|
||||
*
|
||||
* @return a new stack which contains the same objects as this one
|
||||
*/
|
||||
ValueStack clone();
|
||||
|
||||
/**
|
||||
* Queries the stack. Starts with the top, most recent object. If the expression can apply to the object, this
|
||||
* method returns the result of evaluating the expression. If the expression does not apply, this method moves
|
||||
* down the stack to the next object and repeats. Returns {@code null} if the expression doesn't apply to any
|
||||
* objects.
|
||||
*
|
||||
* @param expression
|
||||
* @return the evaluation of the expression against the first applicable object in the stack
|
||||
*/
|
||||
Object get(String expression);
|
||||
|
||||
/**
|
||||
* Queries the stack and converts the result to the specified type. Starts with the top, most recent object. If
|
||||
* the expression can apply to the object, this method returns the result of evaluating the expression converted
|
||||
* to the specified type. If the expression does not apply, this method moves down the stack to the next object
|
||||
* and repeats. Returns {@code null} if the expression doesn't apply to any objects.
|
||||
*
|
||||
* @param expression
|
||||
* @param asType the type to convert the result to
|
||||
* @return the evaluation of the expression against the first applicable object in the stack converted to the
|
||||
* specified type
|
||||
*/
|
||||
<T> T get(String expression, Class<T> asType);
|
||||
|
||||
/**
|
||||
* Queries the stack and converts the result to a {@code String}. Starts with the top, most recent object. If the
|
||||
* expression can apply to the object, this method returns the result of evaluating the expression converted to a
|
||||
* {@code String}. If the expression does not apply, this method moves down the stack to the next object and
|
||||
* repeats. Returns {@code null} if the expression doesn't apply to any objects.
|
||||
*
|
||||
* @param expression
|
||||
* @return the evaluation of the expression against the first applicable object in the stack converted to a {@code
|
||||
* String}
|
||||
*/
|
||||
String getString(String expression);
|
||||
|
||||
/**
|
||||
* Sets a value on an object from the stack. This method starts at the top, most recent object. If the expression
|
||||
* applies to that object, this methods sets the given value on that object using the expression and converting
|
||||
* the type as necessary. If the expression does not apply, this method moves to the next object and repeats.
|
||||
*
|
||||
* @param expression
|
||||
* @param value
|
||||
*/
|
||||
void set(String expression, Object value);
|
||||
|
||||
/**
|
||||
* Returns the number of object on the stack.
|
||||
*
|
||||
* @return size of stack
|
||||
*/
|
||||
int size();
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
@@ -1,5 +0,0 @@
|
||||
Apache Struts
|
||||
Copyright 2000-2007 The Apache Software Foundation
|
||||
|
||||
This product includes software developed by
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
+10
-25
@@ -1,33 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.1.0-SNAPSHOT</version>
|
||||
<version>2.0.7</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-blank</artifactId>
|
||||
@@ -69,11 +47,18 @@
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>maven-jetty-plugin</artifactId>
|
||||
<version>6.0.1</version>
|
||||
<artifactId>maven-jetty6-plugin</artifactId>
|
||||
<configuration>
|
||||
<scanIntervalSeconds>10</scanIntervalSeconds>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-j2ee_1.4_spec</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<action name="Login_*" method="{1}" class="example.Login">
|
||||
<result name="input">/example/Login.jsp</result>
|
||||
<result type="redirectAction">Menu</result>
|
||||
<result type="redirect-action">Menu</result>
|
||||
</action>
|
||||
|
||||
<action name="*" class="example.ExampleSupport">
|
||||
|
||||
+1
-23
@@ -1,33 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.1.0-SNAPSHOT</version>
|
||||
<version>2.0.7</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-mailreader</artifactId>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</interceptor-stack>
|
||||
|
||||
<interceptor-stack name="user-submit" >
|
||||
<interceptor-ref name="tokenSession" />
|
||||
<interceptor-ref name="token-session" />
|
||||
<interceptor-ref name="user"/>
|
||||
</interceptor-stack>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<global-results>
|
||||
<result name="error">/pages/Error.jsp</result>
|
||||
<result name="invalid.token">/pages/Error.jsp</result>
|
||||
<result name="login" type="redirectAction">Login_input</result>
|
||||
<result name="login" type="redirect-action">Login_input</result>
|
||||
</global-results>
|
||||
|
||||
<global-exception-mappings>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
</action>
|
||||
|
||||
<action name="Logout" class="mailreader2.Logout">
|
||||
<result type="redirectAction">Welcome</result>
|
||||
<result type="redirect-action">Welcome</result>
|
||||
</action>
|
||||
|
||||
<action name="Login_*" method="{1}" class="mailreader2.Login">
|
||||
<result name="input">/Login.jsp</result>
|
||||
<result name="cancel" type="redirectAction">Welcome</result>
|
||||
<result type="redirectAction">MainMenu</result>
|
||||
<result name="cancel" type="redirect-action">Welcome</result>
|
||||
<result type="redirect-action">MainMenu</result>
|
||||
<result name="expired" type="chain">ChangePassword</result>
|
||||
<exception-mapping
|
||||
exception="org.apache.struts.apps.mailreader.dao.ExpiredPasswordException"
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
<action name="Registration_*" method="{1}" class="mailreader2.Registration">
|
||||
<result name="input">/Registration.jsp</result>
|
||||
<result type="redirectAction">MainMenu</result>
|
||||
<result type="redirect-action">MainMenu</result>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
</package>
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
<global-results>
|
||||
<result name="input">/Subscription.jsp</result>
|
||||
<result type="redirectAction">Registration_input</result>
|
||||
<result type="redirect-action">Registration_input</result>
|
||||
</global-results>
|
||||
|
||||
<action name="Subscription_save" method="save" class="mailreader2.Subscription">
|
||||
|
||||
@@ -1,23 +1,3 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package mailreader2;
|
||||
|
||||
import com.opensymphony.xwork2.interceptor.Interceptor;
|
||||
|
||||
@@ -5,7 +5,6 @@ button.doReset=DO_RESULT
|
||||
button.doCancel=org.apache.struts.taglib.html.CANCEL
|
||||
button.reset=Reset
|
||||
button.save=Save
|
||||
button.logon=Log on
|
||||
change.message=Your password has expired. Please ask the system administrator to change it.
|
||||
change.try=Try Again
|
||||
change.title=Password Has Expired
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
<hr/>
|
||||
|
||||
<p>
|
||||
<a href="<s:url action="Welcome" includeParams="none"/>"><s:text name="index.title"/></a>
|
||||
<a href="<s:url action="Welcome" />"><s:text name="index.title"/></a>
|
||||
</p>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<s:password key="password" showPassword="true"/>
|
||||
|
||||
<s:submit key="button.logon"/>
|
||||
<s:submit key="button.save"/>
|
||||
|
||||
<s:reset key="button.reset"/>
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<s:hidden name="username"/>
|
||||
</s:else>
|
||||
|
||||
<s:password key="password" showPassword="true"/>
|
||||
<s:password key="password"/>
|
||||
<s:password key="password2"/>
|
||||
<s:textfield key="user.fullName"/>
|
||||
<s:textfield key="user.fromAddress"/>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<s:if test="task=='Delete'">
|
||||
<title><s:text name="subscription.title.delete"/></title>
|
||||
</s:if>
|
||||
<link href="<s:url value="/css/mailreader.css" includeParams="none"/>" rel="stylesheet"
|
||||
<link href="<s:url value="/css/mailreader.css"/>" rel="stylesheet"
|
||||
type="text/css"/>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>Struts2</filter-name>
|
||||
<url-pattern>*.do</url-pattern>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<!-- Application Listener for Mailreader database -->
|
||||
|
||||
@@ -44,12 +44,13 @@
|
||||
|
||||
<hr/>
|
||||
|
||||
<p><s:i18n name="alternate"><a href="http://struts.apache.org/">
|
||||
<p><s:i18n name="alternate">
|
||||
<img src="<s:text name="struts.logo.path"/>"
|
||||
alt="<s:text name="struts.logo.alt"/>" border="0px"/>
|
||||
</a>
|
||||
alt="<s:text name="struts.logo.alt"/>"/>
|
||||
</s:i18n></p>
|
||||
|
||||
<p><a href="<s:url action="Tour" />"><s:text name="index.tour"/></a></p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+17
-20
@@ -1,24 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright 2005-2006 The Apache Software Foundation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
|
||||
@@ -28,7 +25,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.1.0-SNAPSHOT</version>
|
||||
<version>2.0.7</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
@@ -61,7 +58,7 @@
|
||||
<dependency>
|
||||
<groupId>com.hostedqa</groupId>
|
||||
<artifactId>hostedqa-remote-ant</artifactId>
|
||||
<version>1.7</version>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@@ -124,7 +121,7 @@
|
||||
<dependency>
|
||||
<groupId>com.hostedqa</groupId>
|
||||
<artifactId>hostedqa-remote-ant</artifactId>
|
||||
<version>1.7</version>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
||||
@@ -8,8 +8,8 @@ For more on getting started with Struts, see
|
||||
|
||||
WARNING - Additional configuration required for deployment
|
||||
|
||||
Due to difference in portlet container implementations, the portlet
|
||||
WAR is not ready-to-run. Extract the portlet WAR, and then copy the
|
||||
Due to difference in portlet contrainer implementations, the porlet
|
||||
WAR is not ready-to-run. Extract the porlet WAR, and then copy the
|
||||
contents of apps/portlet/src/main/etc/<your_portal_server>/ into the
|
||||
WAR's WEB-INF directory.
|
||||
|
||||
|
||||
+9
-97
@@ -1,33 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.1.0-SNAPSHOT</version>
|
||||
<version>2.0.7</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-portlet</artifactId>
|
||||
@@ -39,38 +17,7 @@
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/portlet/</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/portlet/</url>
|
||||
</scm>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>pluto</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- configure maven-war-plugin to use updated web.xml -->
|
||||
<plugin>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<configuration>
|
||||
<webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- bind 'pluto:assemble' goal to 'process-resources' lifecycle -->
|
||||
<plugin>
|
||||
<groupId>org.apache.pluto</groupId>
|
||||
<artifactId>maven-pluto-plugin</artifactId>
|
||||
<version>1.1.3</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>assemble</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>portlet-api</groupId>
|
||||
@@ -88,11 +35,6 @@
|
||||
<artifactId>struts2-core</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-portlet-plugin</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>velocity</groupId>
|
||||
<artifactId>velocity</artifactId>
|
||||
@@ -109,22 +51,14 @@
|
||||
<artifactId>commons-digester</artifactId>
|
||||
<version>1.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
<version>3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.9</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
@@ -133,26 +67,4 @@
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>rat-maven-plugin</artifactId>
|
||||
<version>1.0-alpha-2</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>pom.xml</include>
|
||||
<include>src/**</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>src/main/etc/gridsphere/README-gridsphere.txt</exclude>
|
||||
<exclude>src/main/etc/gridsphere/struts-portlet</exclude>
|
||||
<exclude>src/main/etc/jetspeed2/README-jetspeed2.txt</exclude>
|
||||
<exclude>src/main/etc/jetspeed2/struts-portlet.psml</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
</project>
|
||||
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* $Id: FormExample.java 471756 2006-11-06 15:01:43Z husted $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.portlet.example;
|
||||
|
||||
import org.apache.struts2.portlet.example.model.Name;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import com.opensymphony.xwork2.ModelDriven;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class FormExampleModelDriven extends ActionSupport implements ModelDriven<Name> {
|
||||
|
||||
private Name name = new Name();
|
||||
|
||||
public Name getModel() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
-81
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* $Id: $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.portlet.example.fileupload;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.apache.struts2.dispatcher.DefaultActionSupport;
|
||||
|
||||
/**
|
||||
* File Upload example's action. <code>FileUploadAction</code>
|
||||
*
|
||||
*/
|
||||
public class FileUploadAction extends DefaultActionSupport {
|
||||
|
||||
private static final long serialVersionUID = 5156288255337069381L;
|
||||
|
||||
private String contentType;
|
||||
private File upload;
|
||||
private String fileName;
|
||||
private String caption;
|
||||
|
||||
// since we are using <s:file name="upload" .../> the file name will be
|
||||
// obtained through getter/setter of <file-tag-name>FileName
|
||||
public String getUploadFileName() {
|
||||
return fileName;
|
||||
}
|
||||
public void setUploadFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
|
||||
// since we are using <s:file name="upload" ... /> the content type will be
|
||||
// obtained through getter/setter of <file-tag-name>ContentType
|
||||
public String getUploadContentType() {
|
||||
return contentType;
|
||||
}
|
||||
public void setUploadContentType(String contentType) {
|
||||
this.contentType = contentType;
|
||||
}
|
||||
|
||||
|
||||
// since we are using <s:file name="upload" ... /> the File itself will be
|
||||
// obtained through getter/setter of <file-tag-name>
|
||||
public File getUpload() {
|
||||
return upload;
|
||||
}
|
||||
public void setUpload(File upload) {
|
||||
this.upload = upload;
|
||||
}
|
||||
|
||||
|
||||
public String getCaption() {
|
||||
return caption;
|
||||
}
|
||||
public void setCaption(String caption) {
|
||||
this.caption = caption;
|
||||
}
|
||||
|
||||
public String upload() throws Exception {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package org.apache.struts2.portlet.example.model;
|
||||
|
||||
public class Name {
|
||||
private String firstName;
|
||||
private String lastName;
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="edit" extends="struts-portlet-default"
|
||||
namespace="/edit">
|
||||
<action name="index"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/edit/index.jsp</result>
|
||||
</action>
|
||||
<action name="test"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/edit/test.jsp</result>
|
||||
</action>
|
||||
<action name="formExampleEdit"
|
||||
class="org.apache.struts2.portlet.example.FormExample" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/edit/formExampleInput.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFormExampleEdit"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="input">
|
||||
/WEB-INF/edit/formExampleInput.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/edit/processFormExampleForward.action?firstName=${firstName}&lastName=${lastName}
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFormExampleForward"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="success">
|
||||
/WEB-INF/edit/formExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
<package name="editTest" extends="edit" namespace="/edit/dummy/test">
|
||||
<action name="testAction"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/edit/namespaceTest.jsp</result>
|
||||
</action>
|
||||
</package>
|
||||
</struts>
|
||||
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="help" extends="struts-portlet-default"
|
||||
namespace="/help">
|
||||
<action name="index"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/help/index.jsp</result>
|
||||
</action>
|
||||
</package>
|
||||
</struts>
|
||||
@@ -1,115 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="view" extends="struts-portlet-default"
|
||||
namespace="/view">
|
||||
<action name="index"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/view/index.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="formExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInput.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFormExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInput.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/formExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="formExampleModelDriven"
|
||||
class="org.apache.struts2.portlet.example.FormExampleModelDriven">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInputModelDriven.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/formExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="validationExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInputValidation.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processValidationExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="success">
|
||||
/WEB-INF/view/formExample.jsp
|
||||
</result>
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInputValidation.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="fileUpload" class="org.apache.struts2.portlet.example.fileupload.FileUploadAction">
|
||||
<result name="input">
|
||||
/WEB-INF/view/fileUpload.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/fileUploadSuccess.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="tokenExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/view/tokenExampleInput.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processTokenExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="input">
|
||||
/WEB-INF/view/tokenExampleInput.jsp
|
||||
</result>
|
||||
<result name="invalid.token">
|
||||
/WEB-INF/view/tokenExampleInput.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/tokenExample.jsp
|
||||
</result>
|
||||
<interceptor-ref name="portletDefaultStackWithToken" />
|
||||
</action>
|
||||
|
||||
<action name="springExample" class="springAction">
|
||||
<result name="success">
|
||||
/WEB-INF/view/springExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="freeMarkerExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport" method="input">
|
||||
<result type="freemarker" name="input">
|
||||
/WEB-INF/view/freeMarkerExampleInput.ftl
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFreeMarkerExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="success">/view/processFreeMarkerView.action?firstName=${firstName}&lastName=${lastName}</result>
|
||||
</action>
|
||||
|
||||
<action name="processFreeMarkerView" class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result type="freemarker" name="success">/WEB-INF/view/freeMarkerExample.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="velocityHelloWorld" class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result type="velocity" name="success">/WEB-INF/view/helloWorld.vm</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
</struts>
|
||||
@@ -0,0 +1 @@
|
||||
struts.objectFactory = spring
|
||||
@@ -1,10 +1,161 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//OpenSymphony Group//XWork 1.1.1//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-1.1.1.dtd">
|
||||
<xwork>
|
||||
<include file="struts-portlet-default.xml" />
|
||||
|
||||
<struts>
|
||||
<include file="struts-view.xml"/>
|
||||
<include file="struts-edit.xml"/>
|
||||
<include file="struts-help.xml"/>
|
||||
</struts>
|
||||
<package name="view" extends="struts-portlet-default"
|
||||
namespace="/view">
|
||||
<action name="index"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/view/index.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="formExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInput.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFormExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInput.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/formExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="validationExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInputValidation.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processValidationExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="success">
|
||||
/WEB-INF/view/formExample.jsp
|
||||
</result>
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInputValidation.jsp
|
||||
</result>
|
||||
<interceptor-ref name="validationWorkflowStack" />
|
||||
</action>
|
||||
|
||||
<action name="tokenExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/view/tokenExampleInput.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processTokenExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="input">
|
||||
/WEB-INF/view/tokenExampleInput.jsp
|
||||
</result>
|
||||
<result name="invalid.token">
|
||||
/WEB-INF/view/tokenExampleInput.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/tokenExample.jsp
|
||||
</result>
|
||||
<interceptor-ref name="token" />
|
||||
<interceptor-ref name="defaultStack" />
|
||||
</action>
|
||||
|
||||
<action name="springExample" class="springAction">
|
||||
<result name="success">
|
||||
/WEB-INF/view/springExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="ajaxExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">
|
||||
/WEB-INF/view/ajaxExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="ajaxData"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/view/ajaxData.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="freeMarkerExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport" method="input">
|
||||
<result type="freemarker" name="input">
|
||||
/WEB-INF/view/freeMarkerExampleInput.ftl
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFreeMarkerExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="success">/view/processFreeMarkerView.action?firstName=${firstName}&lastName=${lastName}</result>
|
||||
</action>
|
||||
|
||||
<action name="processFreeMarkerView" class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result type="freemarker" name="success">/WEB-INF/view/freeMarkerExample.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="velocityHelloWorld" class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result type="velocity" name="success">/WEB-INF/view/helloWorld.vm</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
|
||||
<package name="edit" extends="struts-portlet-default"
|
||||
namespace="/edit">
|
||||
<action name="index"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/edit/index.jsp</result>
|
||||
</action>
|
||||
<action name="test"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/edit/test.jsp</result>
|
||||
</action>
|
||||
<action name="formExampleEdit"
|
||||
class="org.apache.struts2.portlet.example.FormExample" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/edit/formExampleInput.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFormExampleEdit"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="input">
|
||||
/WEB-INF/edtt/formExampleInput.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/edit/processFormExampleForward.action?firstName=${firstName}&lastName=${lastName}
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFormExampleForward"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="success">
|
||||
/WEB-INF/edit/formExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
<package name="editTest" extends="edit" namespace="/edit/dummy/test">
|
||||
<action name="testAction"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/edit/namespaceTest.jsp</result>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
<package name="help" extends="struts-portlet-default"
|
||||
namespace="/help">
|
||||
<action name="index"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/help/index.jsp</result>
|
||||
</action>
|
||||
</package>
|
||||
</xwork>
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//OpenSymphony Group//XWork Validator Config 1.0//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-config-1.0.dtd">
|
||||
<validators>
|
||||
<validator name="required" class="com.opensymphony.xwork2.validator.validators.RequiredFieldValidator"/>
|
||||
<validator name="requiredstring" class="com.opensymphony.xwork2.validator.validators.RequiredStringValidator"/>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE dwr PUBLIC
|
||||
"-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
|
||||
"http://www.getahead.ltd.uk/dwr/dwr10.dtd">
|
||||
<dwr>
|
||||
<allow>
|
||||
<create creator="new" javascript="validator">
|
||||
<param name="class" value="org.apache.struts2.validators.DWRValidator"/>
|
||||
</create>
|
||||
<convert converter="bean" match="com.opensymphony.xwork2.ValidationAwareSupport"/>
|
||||
</allow>
|
||||
|
||||
<signatures>
|
||||
<![CDATA[
|
||||
import java.util.Map;
|
||||
import org.apache.struts2.validators.DWRValidator;
|
||||
|
||||
DWRValidator.doPost(String, String, Map<String, String>);
|
||||
]]>
|
||||
</signatures>
|
||||
</dwr>
|
||||
@@ -1,131 +1,118 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<portlet-app
|
||||
version="1.0"
|
||||
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
|
||||
id="struts-portlet">
|
||||
|
||||
<portlet id="StrutsPortlet">
|
||||
<description xml:lang="EN">Struts Test Portlet</description>
|
||||
<portlet-name>StrutsPortlet</portlet-name>
|
||||
<display-name xml:lang="EN">Struts Test Portlet</display-name>
|
||||
<portlet-app version="1.0" xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" id="struts-portlet">
|
||||
<portlet id="StrutsPortlet">
|
||||
<description xml:lang="EN">Struts Test Portlet</description>
|
||||
<portlet-name>StrutsPortlet</portlet-name>
|
||||
<display-name xml:lang="EN">Struts Test Portlet</display-name>
|
||||
|
||||
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
|
||||
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
|
||||
|
||||
<!-- The view mode namespace. Maps to a namespace in the Struts 2 config file. -->
|
||||
<init-param>
|
||||
<name>viewNamespace</name>
|
||||
<value>/view</value>
|
||||
</init-param>
|
||||
|
||||
<!-- The default action to invoke in view mode. -->
|
||||
<init-param>
|
||||
<name>defaultViewAction</name>
|
||||
<value>index</value>
|
||||
</init-param>
|
||||
|
||||
<!-- The edit mode namespace. Maps to a namespace in the Struts 2 config file. -->
|
||||
<init-param>
|
||||
<name>editNamespace</name>
|
||||
<value>/edit</value>
|
||||
</init-param>
|
||||
|
||||
<!-- The default action to invoke in edit mode. -->
|
||||
<init-param>
|
||||
<name>defaultEditAction</name>
|
||||
<value>index</value>
|
||||
</init-param>
|
||||
|
||||
<!-- The help mode namespace. Maps to a namespace in the Struts 2 config file. -->
|
||||
<init-param>
|
||||
<name>helpNamespace</name>
|
||||
<value>/help</value>
|
||||
</init-param>
|
||||
|
||||
<!-- The default action to invoke in help mode. -->
|
||||
<init-param>
|
||||
<name>defaultHelpAction</name>
|
||||
<value>index</value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<!-- The view mode namespace. Maps to a namespace in the xwork config file -->
|
||||
<name>viewNamespace</name>
|
||||
<value>/view</value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<!-- The default action to invoke in view mode -->
|
||||
<name>defaultViewAction</name>
|
||||
<value>index</value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<!-- The view mode namespace. Maps to a namespace in the xwork config file -->
|
||||
<name>editNamespace</name>
|
||||
<value>/edit</value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<!-- The default action to invoke in view mode -->
|
||||
<name>defaultEditAction</name>
|
||||
<value>index</value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<!-- The view mode namespace. Maps to a namespace in the xwork config file -->
|
||||
<name>helpNamespace</name>
|
||||
<value>/help</value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<!-- The default action to invoke in view mode -->
|
||||
<name>defaultHelpAction</name>
|
||||
<value>index</value>
|
||||
</init-param>
|
||||
|
||||
<expiration-cache>0</expiration-cache>
|
||||
|
||||
<supports>
|
||||
<mime-type>text/html</mime-type>
|
||||
<portlet-mode>view</portlet-mode>
|
||||
<portlet-mode>edit</portlet-mode>
|
||||
<portlet-mode>help</portlet-mode>
|
||||
</supports>
|
||||
|
||||
<expiration-cache>0</expiration-cache>
|
||||
|
||||
<supported-locale>en</supported-locale>
|
||||
<supports>
|
||||
<mime-type>text/html</mime-type>
|
||||
<portlet-mode>edit</portlet-mode>
|
||||
<portlet-mode>help</portlet-mode>
|
||||
</supports>
|
||||
|
||||
<portlet-info>
|
||||
<title>My StrutsPortlet portlet</title>
|
||||
<short-title>SP</short-title>
|
||||
<keywords>struts,portlet</keywords>
|
||||
</portlet-info>
|
||||
</portlet>
|
||||
<supported-locale>en</supported-locale>
|
||||
|
||||
<portlet-info>
|
||||
<title>My StrutsPortlet portlet</title>
|
||||
<short-title>SP</short-title>
|
||||
<keywords>struts,portlet</keywords>
|
||||
</portlet-info>
|
||||
</portlet>
|
||||
|
||||
<portlet id="StrutsPortlet2">
|
||||
<description xml:lang="EN">Struts Test Portlet2</description>
|
||||
<portlet-name>StrutsPortlet2</portlet-name>
|
||||
<display-name xml:lang="EN">Struts Test Portlet2</display-name>
|
||||
<portlet id="StrutsPortlet2">
|
||||
<description xml:lang="EN">Struts Test Portlet2</description>
|
||||
<portlet-name>StrutsPortlet2</portlet-name>
|
||||
<display-name xml:lang="EN">Struts Test Portlet2</display-name>
|
||||
|
||||
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
|
||||
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
|
||||
|
||||
<!-- The view mode namespace. Maps to a namespace in the Struts 2 config file. -->
|
||||
<init-param>
|
||||
<name>viewNamespace</name>
|
||||
<value>/view</value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<!-- The view mode namespace. Maps to a namespace in the xwork config file -->
|
||||
<name>viewNamespace</name>
|
||||
<value>/view</value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<!-- The default action to invoke in view mode -->
|
||||
<name>defaultViewAction</name>
|
||||
<value>index</value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<!-- The view mode namespace. Maps to a namespace in the xwork config file -->
|
||||
<name>editNamespace</name>
|
||||
<value>/edit</value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<!-- The default action to invoke in view mode -->
|
||||
<name>defaultEditAction</name>
|
||||
<value>index</value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<!-- The view mode namespace. Maps to a namespace in the xwork config file -->
|
||||
<name>helpNamespace</name>
|
||||
<value>/help</value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<!-- The default action to invoke in view mode -->
|
||||
<name>defaultHelpAction</name>
|
||||
<value>index</value>
|
||||
</init-param>
|
||||
|
||||
|
||||
<!-- The default action to invoke in view mode. -->
|
||||
<init-param>
|
||||
<name>defaultViewAction</name>
|
||||
<value>index</value>
|
||||
</init-param>
|
||||
|
||||
<expiration-cache>0</expiration-cache>
|
||||
|
||||
<!-- The edit mode namespace. Maps to a namespace in the Struts 2 config file. -->
|
||||
<init-param>
|
||||
<name>editNamespace</name>
|
||||
<value>/edit</value>
|
||||
</init-param>
|
||||
<supports>
|
||||
<mime-type>text/html</mime-type>
|
||||
<portlet-mode>edit</portlet-mode>
|
||||
<portlet-mode>help</portlet-mode>
|
||||
</supports>
|
||||
|
||||
<!-- The default action to invoke in edit mode. -->
|
||||
<init-param>
|
||||
<name>defaultEditAction</name>
|
||||
<value>index</value>
|
||||
</init-param>
|
||||
<supported-locale>en</supported-locale>
|
||||
|
||||
<!-- The help mode namespace. Maps to a namespace in the Struts 2 config file. -->
|
||||
<init-param>
|
||||
<name>helpNamespace</name>
|
||||
<value>/help</value>
|
||||
</init-param>
|
||||
|
||||
<!-- The default action to invoke in help mode. -->
|
||||
<init-param>
|
||||
<name>defaultHelpAction</name>
|
||||
<value>index</value>
|
||||
</init-param>
|
||||
|
||||
<expiration-cache>0</expiration-cache>
|
||||
|
||||
<supports>
|
||||
<mime-type>text/html</mime-type>
|
||||
<portlet-mode>edit</portlet-mode>
|
||||
<portlet-mode>help</portlet-mode>
|
||||
</supports>
|
||||
|
||||
<supported-locale>en</supported-locale>
|
||||
|
||||
<portlet-info>
|
||||
<title>My StrutsPortlet portlet2</title>
|
||||
<short-title>SP2</short-title>
|
||||
<keywords>struts,portlet</keywords>
|
||||
</portlet-info>
|
||||
</portlet>
|
||||
<portlet-info>
|
||||
<title>My StrutsPortlet portlet2</title>
|
||||
<short-title>SP2</short-title>
|
||||
<keywords>struts,portlet</keywords>
|
||||
</portlet-info>
|
||||
</portlet>
|
||||
|
||||
</portlet-app>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<H2>Hello from Ajax!</H2>
|
||||
@@ -0,0 +1 @@
|
||||
This data is fetched via Ajax! The server time is <%= new java.util.Date() %>
|
||||
@@ -0,0 +1,48 @@
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<s:head theme="ajax"/>
|
||||
<link rel="stylesheet" type="text/css" href="<s:url value="/struts/tabs.css"/>">
|
||||
<b>This is a tabbed pane with two panels that fetches data from a remote action via ajax</b>
|
||||
|
||||
<s:tabbedPanel id="test2" theme="simple" >
|
||||
<s:div id="left" label="left" theme="ajax">
|
||||
This is the left pane<br/>
|
||||
<s:form >
|
||||
<s:textfield name="tt" label="Test Text" /> <br/>
|
||||
<s:textfield name="tt2" label="Test Text2" />
|
||||
</s:form>
|
||||
</s:div>
|
||||
<s:div href="<s:url action="ajaxData"/>" id="ryh1" theme="ajax" label="remote one" />
|
||||
<s:div id="middle" label="middle" theme="ajax">
|
||||
middle tab<br/>
|
||||
<s:form >
|
||||
<s:textfield name="tt" label="Test Text44" /> <br/>
|
||||
<s:textfield name="tt2" label="Test Text442" />
|
||||
</s:form>
|
||||
</s:div>
|
||||
<s:div href="<s:url action="ajaxData"/>" id="ryh21" theme="ajax" label="remote right" />
|
||||
</s:tabbedPanel>
|
||||
|
||||
<p/>
|
||||
A DIV that waits for 5 seconds before loading the contents
|
||||
<s:div
|
||||
id="once"
|
||||
theme="ajax"
|
||||
cssStyle="border: 1px solid yellow;"
|
||||
href="<s:url action="ajaxData"/>"
|
||||
delay="5000"
|
||||
loadingText="loading...">
|
||||
Waiting for data</s:div>
|
||||
<p/>
|
||||
A DIV that is updated every 2 seconds
|
||||
<s:div
|
||||
id="twoseconds"
|
||||
cssStyle="border: 1px solid yellow;"
|
||||
href="<s:url action="ajaxData"/>"
|
||||
theme="ajax"
|
||||
delay="2000"
|
||||
updateFreq="2000"
|
||||
errorText="There was an error"
|
||||
loadingText="loading...">Initial Content
|
||||
</s:div>
|
||||
<p/>
|
||||
<a href="<s:url action="index"/>">Back to front page</a>
|
||||
@@ -1,13 +0,0 @@
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
|
||||
<h1>Fileupload sample</h1>
|
||||
|
||||
<s:actionerror />
|
||||
<s:fielderror />
|
||||
<s:form action="fileUpload" method="POST" enctype="multipart/form-data">
|
||||
<s:file name="upload" label="File"/>
|
||||
<s:textfield name="caption" label="Caption"/>
|
||||
<s:submit />
|
||||
</s:form>
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
|
||||
<h1>Fileupload sample</h1>
|
||||
|
||||
<p>
|
||||
<ul>
|
||||
<li>ContentType: <s:property value="uploadContentType" /></li>
|
||||
<li>FileName: <s:property value="uploadFileName" /></li>
|
||||
<li>File: <s:property value="upload" /></li>
|
||||
<li>Caption:<s:property value="caption" /></li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
|
||||
<H2>Input your name</H2>
|
||||
<s:form action="formExampleModelDriven" method="POST">
|
||||
<s:textfield label="First name" name="firstName" value="%{firstName}"/>
|
||||
<s:textfield label="Last name" name="lastName" value="%{lastName}"/>
|
||||
<s:submit value="Submit the form"/>
|
||||
</s:form>
|
||||
@@ -4,11 +4,10 @@
|
||||
Here you'll find examples of what is possible with the Struts Portlet integration framework.
|
||||
<ul>
|
||||
<li><a href="<s:url action="formExample"/>">A simple form</a></li>
|
||||
<li><a href="<s:url action="formExampleModelDriven" method="input"/>">Model driven example</li>
|
||||
<li><a href="<s:url action="validationExample"/>">Validation</a></li>
|
||||
<li><a href="<s:url action="tokenExample"/>">Token</a></li>
|
||||
<li><a href="<s:url action="springExample"/>">Spring integration</a></li>
|
||||
<li><a href="<s:url action="fileUpload" method="input"/>">File upload</li>
|
||||
<li><a href="<s:url action="ajaxExample"/>">Ajax</a></li>
|
||||
<li><a href="<s:url action="freeMarkerExample"/>">FreeMarker</a></li>
|
||||
<li><a href="<s:url action="velocityHelloWorld"/>">Velocity</a></li>
|
||||
<li><a href="<s:url action="index" portletMode="edit"/>">Go to edit mode and see what's there</a></li>
|
||||
|
||||
@@ -4,30 +4,46 @@
|
||||
<!-- Uncomment/comment this if you need/don't need Spring support -->
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>
|
||||
/WEB-INF/applicationContext*.xml
|
||||
</param-value>
|
||||
<param-value>/WEB-INF/applicationContext*.xml</param-value>
|
||||
</context-param>
|
||||
<filter id="filterdispatcher">
|
||||
<filter-name>action2</filter-name>
|
||||
<filter-class>
|
||||
org.apache.struts2.dispatcher.FilterDispatcher
|
||||
</filter-class>
|
||||
</filter>
|
||||
|
||||
<filter id="filterdispatcher">
|
||||
<filter-name>Struts2</filter-name>
|
||||
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>Struts2</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>action2</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<listener>
|
||||
<listener-class>
|
||||
org.springframework.web.context.ContextLoaderListener
|
||||
</listener-class>
|
||||
</listener>
|
||||
<listener>
|
||||
<listener-class> org.springframework.web.context.ContextLoaderListener
|
||||
</listener-class>
|
||||
<listener-class>
|
||||
org.apache.struts2.portlet.context.ServletContextHolderListener
|
||||
</listener-class>
|
||||
</listener>
|
||||
|
||||
<!-- Uncomment to use the dispatcher servlet -->
|
||||
<!--<servlet id="Struts2PortletDispatcherServlet">
|
||||
<servlet-name>Struts2PortletDispatcherServlet</servlet-name>
|
||||
<servlet-class>org.apache.struts2.portlet.dispatcher.DispatcherServlet</servlet-class>
|
||||
</servlet>-->
|
||||
|
||||
|
||||
<servlet id="preparator">
|
||||
<servlet-name>preparator</servlet-name>
|
||||
<servlet-class>
|
||||
org.apache.struts2.portlet.context.PreparatorServlet
|
||||
</servlet-class>
|
||||
</servlet>
|
||||
<servlet id="dwr">
|
||||
<servlet-name>dwr</servlet-name>
|
||||
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>dwr</servlet-name>
|
||||
<url-pattern>/dwr/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
</web-app>
|
||||
|
||||
+1
-36
@@ -1,33 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.1.0-SNAPSHOT</version>
|
||||
<version>2.0.7</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-showcase</artifactId>
|
||||
@@ -60,12 +38,6 @@
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-dojo-plugin</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-jsf-plugin</artifactId>
|
||||
@@ -90,13 +62,6 @@
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.tiles</groupId>
|
||||
<artifactId>tiles-jsp</artifactId>
|
||||
<version>2.0.4</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-codebehind-plugin</artifactId>
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ public class DynamicTreeSelectAction extends ActionSupport {
|
||||
|
||||
|
||||
public String getNodeName() {
|
||||
return currentCategory != null ? currentCategory.getName() : "Node not found";
|
||||
return currentCategory.getName();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* $Id: pom.xml 559206 2007-07-24 21:01:18Z apetrelli $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.showcase;
|
||||
|
||||
import org.apache.struts2.showcase.ajax.tree.Category;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
public class ShowAjaxDynamicTreeAction extends ActionSupport {
|
||||
private int nodeId = 1;
|
||||
|
||||
public Category getCategory() {
|
||||
return Category.getById(nodeId);
|
||||
}
|
||||
|
||||
public int getNodeId() {
|
||||
return nodeId;
|
||||
}
|
||||
|
||||
public void setNodeId(int nodeId) {
|
||||
this.nodeId = nodeId;
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,6 @@ public class UITagExample extends ActionSupport implements Validateable {
|
||||
|
||||
String name;
|
||||
Date birthday;
|
||||
Date wakeup;
|
||||
String bio;
|
||||
String favouriteColor;
|
||||
List friends;
|
||||
@@ -242,13 +241,7 @@ public class UITagExample extends ActionSupport implements Validateable {
|
||||
return this.thoughts;
|
||||
}
|
||||
|
||||
public Date getWakeup() {
|
||||
return wakeup;
|
||||
}
|
||||
|
||||
public void setWakeup(Date wakeup) {
|
||||
this.wakeup = wakeup;
|
||||
}
|
||||
|
||||
public String doSubmit() {
|
||||
return SUCCESS;
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.showcase.action;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
public class ExampleAction extends ActionSupport {
|
||||
public static final String CONSTANT = "Struts Rocks!";
|
||||
|
||||
public static Date getCurrentDate() {
|
||||
return new Date();
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "John Galt";
|
||||
}
|
||||
|
||||
public String[] getBands() {
|
||||
return new String[] { "Pink Floyd", "Metallica", "Guns & Roses" };
|
||||
}
|
||||
|
||||
public List<String> getMovies() {
|
||||
return Arrays.asList("Lord of the Rings", "Matrix");
|
||||
}
|
||||
|
||||
public Book getBook() {
|
||||
return new Book("Iliad", "Homer");
|
||||
}
|
||||
|
||||
public Map<String, Book> getBooks() {
|
||||
Map<String, Book> books = new HashMap<String, Book>();
|
||||
books.put("Iliad", new Book("Iliad", "Homer"));
|
||||
books.put("The Republic", new Book("The Replublic", "Plato"));
|
||||
books.put("Thus Spake Zarathustra", new Book("Thus Spake Zarathustra",
|
||||
"Friedrich Nietzsche"));
|
||||
return books;
|
||||
}
|
||||
}
|
||||
|
||||
class Book {
|
||||
private String title;
|
||||
private String author;
|
||||
|
||||
public Book(String title, String author) {
|
||||
this.title = title;
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public void setAuthor(String author) {
|
||||
this.author = author;
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.showcase.action;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.interceptor.annotations.After;
|
||||
|
||||
/**
|
||||
* Will only work on containers that unzip war files
|
||||
*
|
||||
*/
|
||||
public class JSPEvalAction extends ExampleAction {
|
||||
private String jsp;
|
||||
private final static String FILE = "/interactive/demo.jsp";
|
||||
|
||||
public String execute() throws IOException {
|
||||
if (jsp != null) {
|
||||
//write it to file
|
||||
URL url = ServletActionContext.getServletContext().getResource(FILE);
|
||||
BufferedWriter writer = new BufferedWriter(new FileWriter(new File(url
|
||||
.getFile())));
|
||||
try {
|
||||
//directive
|
||||
writer.write("<%@ taglib prefix=\"s\" uri=\"/struts-tags\" %>");
|
||||
writer.write(jsp);
|
||||
} finally {
|
||||
if (writer != null)
|
||||
writer.close();
|
||||
}
|
||||
}
|
||||
return Action.SUCCESS;
|
||||
}
|
||||
|
||||
@After
|
||||
public void cleanUp() throws IOException {
|
||||
URL url = ServletActionContext.getServletContext().getResource(FILE);
|
||||
FileOutputStream out = new FileOutputStream(new File(url.getFile()));
|
||||
try {
|
||||
out.getChannel().truncate(0);
|
||||
} finally {
|
||||
if (out != null)
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
public void setJsp(String jsp) {
|
||||
this.jsp = jsp;
|
||||
}
|
||||
|
||||
}
|
||||
-20
@@ -1,23 +1,3 @@
|
||||
/*
|
||||
* $Id: pom.xml 559206 2007-07-24 21:01:18Z apetrelli $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.showcase.ajax;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -21,5 +21,5 @@
|
||||
package org.apache.struts2.showcase.chat;
|
||||
|
||||
public class Constants {
|
||||
public static String UPDATE_FREQ = "5000";
|
||||
public static String UPDATE_FREQ = "30000";
|
||||
}
|
||||
|
||||
+1
-14
@@ -30,9 +30,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.util.ServletContextAware;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
@@ -72,10 +70,6 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
|
||||
}
|
||||
}
|
||||
pageLines = read(in, -1);
|
||||
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
}
|
||||
|
||||
if (className != null && className.trim().length() > 0) {
|
||||
@@ -85,15 +79,9 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
|
||||
in = servletContext.getResourceAsStream("/WEB-INF/src"+className);
|
||||
}
|
||||
classLines = read(in, -1);
|
||||
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
}
|
||||
|
||||
String rootPath = ServletActionContext.getServletContext().getRealPath("/");
|
||||
|
||||
if (config != null && config.trim().length() > 0 && (rootPath == null || config.startsWith(rootPath))) {
|
||||
if (config != null && config.trim().length() > 0) {
|
||||
int pos = config.lastIndexOf(':');
|
||||
configLine = Integer.parseInt(config.substring(pos+1));
|
||||
config = config.substring(0, pos).replace("//", "/");
|
||||
@@ -102,7 +90,6 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param className the className to set
|
||||
*/
|
||||
|
||||
@@ -2,5 +2,4 @@ Apache Struts
|
||||
Copyright 2000-2007 The Apache Software Foundation
|
||||
|
||||
This product includes software developed by
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
Nifty Corners (http://www.html.it/articoli/nifty/index.html).
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
@@ -74,13 +74,5 @@
|
||||
<action name="AutocompleterExample" class="org.apache.struts2.showcase.ajax.AutocompleterExampleAction">
|
||||
<result type="freemarker">/ajax/options.ftl</result>
|
||||
</action>
|
||||
<action name="quizAjax" class="org.apache.struts2.showcase.validation.QuizAction">
|
||||
<interceptor-ref name="jsonValidationWorkflowStack"/>
|
||||
<result name="input">/validation/quiz-ajax.jsp</result>
|
||||
<result>/validation/quiz-success.jsp</result>
|
||||
</action>
|
||||
<action name="getNodes" class="org.apache.struts2.showcase.ShowAjaxDynamicTreeAction">
|
||||
<result type="freemarker">/tags/ui/treeExampleAjaxDynamic.ftl</result>
|
||||
</action>
|
||||
</package>
|
||||
</struts>
|
||||
|
||||
@@ -2,24 +2,24 @@
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
|
||||
<struts>
|
||||
<package name="chat" extends="struts-default" namespace="/chat">
|
||||
<interceptors>
|
||||
<interceptor name="chatAuthentication"
|
||||
class="org.apache.struts2.showcase.chat.ChatAuthenticationInterceptor" />
|
||||
<interceptor-stack name="chatAuthenticationStack">
|
||||
<interceptor-ref name="createSession" />
|
||||
<interceptor-ref name="exception"/>
|
||||
<package name="chat" extends="struts-default" namespace="/chat">
|
||||
<interceptors>
|
||||
<interceptor name="chatAuthentication"
|
||||
class="org.apache.struts2.showcase.chat.ChatAuthenticationInterceptor" />
|
||||
<interceptor-stack name="chatAuthenticationStack">
|
||||
<interceptor-ref name="createSession" />
|
||||
<interceptor-ref name="exception"/>
|
||||
<interceptor-ref name="alias"/>
|
||||
<interceptor-ref name="servletConfig"/>
|
||||
<interceptor-ref name="servlet-config"/>
|
||||
<interceptor-ref name="prepare"/>
|
||||
<interceptor-ref name="i18n"/>
|
||||
<interceptor-ref name="chain"/>
|
||||
<interceptor-ref name="debugging"/>
|
||||
<interceptor-ref name="modelDriven"/>
|
||||
<interceptor-ref name="model-driven"/>
|
||||
<interceptor-ref name="fileUpload"/>
|
||||
<interceptor-ref name="staticParams"/>
|
||||
<interceptor-ref name="static-params"/>
|
||||
<interceptor-ref name="params"/>
|
||||
<interceptor-ref name="conversionError"/>
|
||||
<interceptor-ref name="validation">
|
||||
@@ -29,62 +29,62 @@
|
||||
<param name="excludeMethods">input,back,cancel,browse</param>
|
||||
</interceptor-ref>
|
||||
<interceptor-ref name="chatAuthentication" />
|
||||
</interceptor-stack>
|
||||
</interceptors>
|
||||
|
||||
<global-results>
|
||||
<result name="login" type="freemarker">/chat/chatLogin.ftl</result>
|
||||
</global-results>
|
||||
|
||||
<action name="main">
|
||||
<interceptor-ref name="chatAuthentication" />
|
||||
<result type="freemarker">/chat/roomSelection.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="login" class="chatLoginAction">
|
||||
<interceptor-ref name="defaultStack" />
|
||||
<result type="redirect">/chat/showRooms.action</result>
|
||||
<result name="input" type="freemarker">/chat/chatLogin.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="logout" class="chatLogoutAction">
|
||||
<interceptor-ref name="defaultStack" />
|
||||
<result type="redirect">/chat/main.action</result>
|
||||
</action>
|
||||
|
||||
<action name="showRooms">
|
||||
<interceptor-ref name="chatAuthenticationStack" />
|
||||
<result type="freemarker">/chat/roomSelection.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="enterRoom" class="enterRoomAction">
|
||||
<interceptor-ref name="chatAuthenticationStack" />
|
||||
<result type="freemarker">/chat/showRoom.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="exitRoom" class="exitRoomAction">
|
||||
<interceptor-ref name="chatAuthenticationStack" />
|
||||
<result type="redirect">/chat/showRooms.action</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
|
||||
<package name="chat-remote" extends="struts-default" namespace="/chat/ajax">
|
||||
<interceptors>
|
||||
<interceptor name="chatAuthentication"
|
||||
class="org.apache.struts2.showcase.chat.ChatAuthenticationInterceptor" />
|
||||
<interceptor-stack name="chatAuthenticationStack">
|
||||
<interceptor-ref name="createSession" />
|
||||
<interceptor-ref name="exception"/>
|
||||
</interceptor-stack>
|
||||
</interceptors>
|
||||
|
||||
<global-results>
|
||||
<result name="login" type="freemarker">/chat/chatLogin.ftl</result>
|
||||
</global-results>
|
||||
|
||||
<action name="main">
|
||||
<interceptor-ref name="chatAuthentication" />
|
||||
<result type="freemarker">/chat/roomSelection.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="login" class="chatLoginAction">
|
||||
<interceptor-ref name="defaultStack" />
|
||||
<result type="redirect">/chat/showRooms.action</result>
|
||||
<result name="input" type="freemarker">/chat/chatLogin.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="logout" class="chatLogoutAction">
|
||||
<interceptor-ref name="defaultStack" />
|
||||
<result type="redirect">/chat/main.action</result>
|
||||
</action>
|
||||
|
||||
<action name="showRooms">
|
||||
<interceptor-ref name="chatAuthenticationStack" />
|
||||
<result type="freemarker">/chat/roomSelection.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="enterRoom" class="enterRoomAction">
|
||||
<interceptor-ref name="chatAuthenticationStack" />
|
||||
<result type="freemarker">/chat/showRoom.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="exitRoom" class="exitRoomAction">
|
||||
<interceptor-ref name="chatAuthenticationStack" />
|
||||
<result type="redirect">/chat/showRooms.action</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
|
||||
<package name="chat-remote" extends="struts-default" namespace="/chat/ajax">
|
||||
<interceptors>
|
||||
<interceptor name="chatAuthentication"
|
||||
class="org.apache.struts2.showcase.chat.ChatAuthenticationInterceptor" />
|
||||
<interceptor-stack name="chatAuthenticationStack">
|
||||
<interceptor-ref name="createSession" />
|
||||
<interceptor-ref name="exception"/>
|
||||
<interceptor-ref name="alias"/>
|
||||
<interceptor-ref name="servletConfig"/>
|
||||
<interceptor-ref name="servlet-config"/>
|
||||
<interceptor-ref name="prepare"/>
|
||||
<interceptor-ref name="i18n"/>
|
||||
<interceptor-ref name="chain"/>
|
||||
<interceptor-ref name="debugging"/>
|
||||
<interceptor-ref name="modelDriven"/>
|
||||
<interceptor-ref name="model-driven"/>
|
||||
<interceptor-ref name="fileUpload"/>
|
||||
<interceptor-ref name="staticParams"/>
|
||||
<interceptor-ref name="static-params"/>
|
||||
<interceptor-ref name="params"/>
|
||||
<interceptor-ref name="conversionError"/>
|
||||
<interceptor-ref name="validation">
|
||||
@@ -94,42 +94,42 @@
|
||||
<param name="excludeMethods">input,back,cancel,browse</param>
|
||||
</interceptor-ref>
|
||||
<interceptor-ref name="chatAuthentication" />
|
||||
</interceptor-stack>
|
||||
</interceptors>
|
||||
|
||||
|
||||
<action name="usersAvailable" class="usersAvailableAction">
|
||||
<interceptor-ref name="chatAuthenticationStack" />
|
||||
<result type="freemarker">/chat/usersAvailable.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="roomsAvailable" class="roomsAvailableAction">
|
||||
<interceptor-ref name="chatAuthenticationStack" />
|
||||
<result type="freemarker">/chat/roomsAvailable.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="createRoom" class="crudRoomAction" method="create">
|
||||
<interceptor-ref name="chatAuthenticationStack" />
|
||||
<result type="freemarker">/chat/createRoom.ftl</result>
|
||||
<result name="input" type="freemarker">/chat/createRoom.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="messagesAvailableInRoom" class="messagesAvailableInRoomAction">
|
||||
<interceptor-ref name="chatAuthenticationStack" />
|
||||
<result type="freemarker">/chat/messagesAvailableInRoom.ftl</result>
|
||||
<result name="input" type="freemarker">/chat/messagesAvailableInRoom.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="sendMessageToRoom" class="sendMessageToRoomAction">
|
||||
<interceptor-ref name="chatAuthenticationStack" />
|
||||
<result type="freemarker">/chat/sendMessageToRoomResult.ftl</result>
|
||||
<result name="input" type="freemarker">/chat/sendMessageToRoomResult.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="usersAvailableInRoom" class="usersAvailableInRoomAction">
|
||||
<interceptor-ref name="chatAuthenticationStack" />
|
||||
<result type="freemarker">/chat/usersAvailableInRoom.ftl</result>
|
||||
</action>
|
||||
</package>
|
||||
</struts>
|
||||
</interceptor-stack>
|
||||
</interceptors>
|
||||
|
||||
|
||||
<action name="usersAvailable" class="usersAvailableAction">
|
||||
<interceptor-ref name="chatAuthenticationStack" />
|
||||
<result type="freemarker">/chat/usersAvailable.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="roomsAvailable" class="roomsAvailableAction">
|
||||
<interceptor-ref name="chatAuthenticationStack" />
|
||||
<result type="freemarker">/chat/roomsAvailable.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="createRoom" class="crudRoomAction" method="create">
|
||||
<interceptor-ref name="chatAuthenticationStack" />
|
||||
<result type="freemarker">/chat/createRoom.ftl</result>
|
||||
<result name="input" type="freemarker">/chat/createRoom.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="messagesAvailableInRoom" class="messagesAvailableInRoomAction">
|
||||
<interceptor-ref name="chatAuthenticationStack" />
|
||||
<result type="freemarker">/chat/messagesAvailableInRoom.ftl</result>
|
||||
<result name="input" type="freemarker">/chat/messagesAvailableInRoom.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="sendMessageToRoom" class="sendMessageToRoomAction">
|
||||
<interceptor-ref name="chatAuthenticationStack" />
|
||||
<result type="freemarker">/chat/sendMessageToRoomResult.ftl</result>
|
||||
<result name="input" type="freemarker">/chat/sendMessageToRoomResult.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="usersAvailableInRoom" class="usersAvailableInRoomAction">
|
||||
<interceptor-ref name="chatAuthenticationStack" />
|
||||
<result type="freemarker">/chat/usersAvailableInRoom.ftl</result>
|
||||
</action>
|
||||
</package>
|
||||
</struts>
|
||||
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
<result name="input">enterPersonInfo.jsp</result>
|
||||
</action>
|
||||
<action name="showPersonJspCode">
|
||||
<result type="plainText">/conversion/enterPersonInfo.jsp</result>
|
||||
<result type="plaintext">/conversion/enterPersonInfo.jsp</result>
|
||||
</action>
|
||||
<action name="showPersonActionJavaCode">
|
||||
<result type="plainText">/conversion/PersonAction.java.txt</result>
|
||||
<result type="plaintext">/conversion/PersonAction.java.txt</result>
|
||||
</action>
|
||||
<action name="showPersonJavaCode">
|
||||
<result type="plainText">/conversion/Person.java.txt</result>
|
||||
<result type="plaintext">/conversion/Person.java.txt</result>
|
||||
</action>
|
||||
|
||||
|
||||
@@ -37,13 +37,13 @@
|
||||
<result name="input">enterAddressInfo.jsp</result>
|
||||
</action>
|
||||
<action name="showAddressJspCode">
|
||||
<result type="plainText">/conversion/enterAddressInfo.jsp</result>
|
||||
<result type="plaintext">/conversion/enterAddressInfo.jsp</result>
|
||||
</action>
|
||||
<action name="showAddressActionJavaCode">
|
||||
<result type="plainText">/conversion/AddressAction.java.txt</result>
|
||||
<result type="plaintext">/conversion/AddressAction.java.txt</result>
|
||||
</action>
|
||||
<action name="showAddressJavaCode">
|
||||
<result type="plainText">/conversion/Address.java.txt</result>
|
||||
<result type="plaintext">/conversion/Address.java.txt</result>
|
||||
</action>
|
||||
|
||||
|
||||
@@ -56,19 +56,19 @@
|
||||
<result name="input">enterOperations.jsp</result>
|
||||
</action>
|
||||
<action name="showEnumJspCode">
|
||||
<result type="plainText">/conversion/enterOperations.jsp</result>
|
||||
<result type="plaintext">/conversion/enterOperations.jsp</result>
|
||||
</action>
|
||||
<action name="showOperationsEnumJavaCode">
|
||||
<result type="plainText">/conversion/OperationsEnum.java.txt</result>
|
||||
<result type="plaintext">/conversion/OperationsEnum.java.txt</result>
|
||||
</action>
|
||||
<action name="showOperationEnumActionJavaCode">
|
||||
<result type="plainText">/conversion/OperationsEnumAction.java.txt</result>
|
||||
<result type="plaintext">/conversion/OperationsEnumAction.java.txt</result>
|
||||
</action>
|
||||
<action name="showEnumTypeConverterJavaCode">
|
||||
<result type="plainText">/conversion/EnumTypeConverter.java.txt</result>
|
||||
<result type="plaintext">/conversion/EnumTypeConverter.java.txt</result>
|
||||
</action>
|
||||
<action name="showOperationsEnumActionConversionProperties">
|
||||
<result type="plainText">/conversion/OperationsEnumActionConversion.txt</result>
|
||||
<result type="plaintext">/conversion/OperationsEnumActionConversion.txt</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<default-action-ref name="download"/>
|
||||
|
||||
<action name="download" class="org.apache.struts2.showcase.filedownload.FileDownloadAction">
|
||||
<param name="inputPath">/images/struts.gif</param>
|
||||
<param name="inputPath">\images\struts.gif</param>
|
||||
<result name="success" type="stream">
|
||||
<param name="contentType">image/gif</param>
|
||||
<param name="inputName">inputStream</param>
|
||||
@@ -20,7 +20,7 @@
|
||||
</action>
|
||||
|
||||
<action name="download2" class="org.apache.struts2.showcase.filedownload.FileDownloadAction">
|
||||
<param name="inputPath">/images/struts-gif.zip</param>
|
||||
<param name="inputPath">\images\struts-gif.zip</param>
|
||||
<result name="success" type="stream">
|
||||
<param name="contentType">application/zip</param>
|
||||
<param name="inputName">inputStream</param>
|
||||
|
||||
@@ -5,44 +5,45 @@
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="integration" extends="struts1-default" namespace="/integration">
|
||||
|
||||
<interceptors>
|
||||
<interceptor name="gangsterForm" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor">
|
||||
<param name="className">org.apache.struts2.showcase.integration.GangsterForm</param>
|
||||
<param name="name">gangsterForm</param>
|
||||
</interceptor>
|
||||
<interceptor name="gangsterValidation" class="org.apache.struts2.s1.ActionFormValidationInterceptor">
|
||||
<param name="pathnames">/org/apache/struts/validator/validator-rules.xml,/WEB-INF/validation.xml</param>
|
||||
</interceptor>
|
||||
|
||||
<interceptor-stack name="integration">
|
||||
<interceptor-ref name="staticParams"/>
|
||||
<interceptor-ref name="gangsterForm"/>
|
||||
<interceptor-ref name="modelDriven"/>
|
||||
<interceptor-ref name="actionForm-reset"/>
|
||||
<interceptor-ref name="basicStack"/>
|
||||
<interceptor-ref name="gangsterValidation"/>
|
||||
<interceptor-ref name="workflow"/>
|
||||
</interceptor-stack>
|
||||
</interceptors>
|
||||
|
||||
<default-interceptor-ref name="integration"/>
|
||||
<default-action-ref name="editGangster"/>
|
||||
|
||||
<!-- Display entry page that uses Model-Driven technique -->
|
||||
<action name="editGangster" class="org.apache.struts2.s1.Struts1Action">
|
||||
<param name="className">org.apache.struts2.showcase.integration.EditGangsterAction</param>
|
||||
<result>modelDriven.jsp</result>
|
||||
</action>
|
||||
|
||||
<!-- Display the result page whose content is populated using the Model-Driven technique -->
|
||||
<action name="saveGangster" class="org.apache.struts2.s1.Struts1Action">
|
||||
<param name="className">org.apache.struts2.showcase.integration.SaveGangsterAction</param>
|
||||
<param name="validate">true</param>
|
||||
<result name="input">modelDriven.jsp</result>
|
||||
<result>modelDrivenResult.jsp</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
</struts>
|
||||
<package name="integration" extends="struts1-default" namespace="/integration">
|
||||
|
||||
<interceptors>
|
||||
<interceptor name="gangsterForm" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor">
|
||||
<param name="className">org.apache.struts2.showcase.integration.GangsterForm</param>
|
||||
<param name="name">gangsterForm</param>
|
||||
</interceptor>
|
||||
<interceptor name="gangsterValidation" class="org.apache.struts2.s1.ActionFormValidationInterceptor">
|
||||
<param name="pathnames">/org/apache/struts/validator/validator-rules.xml,/WEB-INF/validation.xml</param>
|
||||
</interceptor>
|
||||
|
||||
<interceptor-stack name="integration">
|
||||
<interceptor-ref name="static-params"/>
|
||||
<interceptor-ref name="gangsterForm"/>
|
||||
<interceptor-ref name="model-driven"/>
|
||||
<interceptor-ref name="actionForm-reset"/>
|
||||
<interceptor-ref name="basicStack"/>
|
||||
<interceptor-ref name="gangsterValidation"/>
|
||||
<interceptor-ref name="workflow"/>
|
||||
</interceptor-stack>
|
||||
</interceptors>
|
||||
|
||||
<default-interceptor-ref name="integration" />
|
||||
<default-action-ref name="editGangster" />
|
||||
|
||||
<!-- Diplay entry page that uses Model-Driven technique -->
|
||||
<action name="editGangster" class="org.apache.struts2.s1.Struts1Action">
|
||||
<param name="className">org.apache.struts2.showcase.integration.EditGangsterAction</param>
|
||||
<result>modelDriven.jsp</result>
|
||||
</action>
|
||||
|
||||
<!-- Display the result page whose content is populated using the Model-Driven technique -->
|
||||
<action name="saveGangster" class="org.apache.struts2.s1.Struts1Action">
|
||||
<param name="className">org.apache.struts2.showcase.integration.SaveGangsterAction</param>
|
||||
<param name="validate">true</param>
|
||||
<result name="input">modelDriven.jsp</result>
|
||||
<result>modelDrivenResult.jsp</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
</struts>
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="ognl" namespace="/nodecorate" extends="struts-default">
|
||||
<action name="jspEval" class="org.apache.struts2.showcase.action.JSPEvalAction">
|
||||
<interceptor-ref name="params"/>
|
||||
<interceptor-ref name="debugging"/>
|
||||
<interceptor-ref name="annotationWorkflow" />
|
||||
<result>/interactive/demo.jsp</result>
|
||||
</action>
|
||||
<action name="example" class="org.apache.struts2.showcase.action.ExampleAction" />
|
||||
</package>
|
||||
</struts>
|
||||
@@ -22,7 +22,7 @@
|
||||
<result>/tags/non-ui/actionTag/includedPage3.jsp</result>
|
||||
</action>
|
||||
<action name="lookAtSource">
|
||||
<result type="plainText">/tags/non-ui/actionTag/showActionTagDemo.jsp</result>
|
||||
<result type="plaintext">/tags/non-ui/actionTag/showActionTagDemo.jsp</result>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
@@ -104,10 +104,10 @@
|
||||
<result type="freemarker">/tags/non-ui/actionPrefix/redirectActionPrefix.ftl</result>
|
||||
</action>
|
||||
<action name="redirectActionPrefixAction">
|
||||
<result type="redirect">redirectActionPrefix</result>
|
||||
<result type="redirect-action">redirectActionPrefix</result>
|
||||
</action>
|
||||
<action name="viewSource">
|
||||
<result type="plainText">/tags/non-ui/actionPrefix/actionPrefixExample.ftl</result>
|
||||
<result type="plaintext">/tags/non-ui/actionPrefix/actionPrefixExample.ftl</result>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
|
||||
@@ -47,12 +47,9 @@
|
||||
|
||||
<!-- END SNIPPET: treeExampleDynamicXWorkXml -->
|
||||
|
||||
<action name="showDynamicAjaxTreeAction">
|
||||
<result>/tags/ui/treeExampleAjaxDynamic.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="showComponentTagExampleCode">
|
||||
<result type="plainText">/tags/ui/componentTagExample.jsp</result>
|
||||
<result type="plaintext">/tags/ui/componentTagExample.jsp</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
|
||||
@@ -17,10 +17,6 @@
|
||||
<result type="tiles">showcase.freemarker</result>
|
||||
</action>
|
||||
|
||||
<action name="freemarkerLayout">
|
||||
<result type="tiles">showcase.freemarkerLayout</result>
|
||||
</action>
|
||||
|
||||
<action name="sanity">
|
||||
<result type="redirect">/tiles/layout.jsp</result>
|
||||
<result type="redirect" name="success">/tiles/layout.jsp</result>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
<action name="transfer3" class="org.apache.struts2.showcase.token.TokenAction">
|
||||
<interceptor-ref name="defaultStack"/>
|
||||
<interceptor-ref name="tokenSession"/>
|
||||
<interceptor-ref name="token-session"/>
|
||||
<result name="invalid.token">doublePost.jsp</result>
|
||||
<result name="success" type="redirect">transferDone.jsp</result>
|
||||
</action>
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
</action>
|
||||
|
||||
<action name="quizAjax" class="org.apache.struts2.showcase.validation.QuizAction">
|
||||
<interceptor-ref name="jsonValidationWorkflowStack"/>
|
||||
<result name="input">quiz-ajax.jsp</result>
|
||||
<result>quiz-success.jsp</result>
|
||||
</action>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<!-- Some or all of these can be flipped to true for debugging -->
|
||||
<constant name="struts.i18n.reload" value="false" />
|
||||
<constant name="struts.devMode" value="true" />
|
||||
<constant name="struts.devMode" value="false" />
|
||||
<constant name="struts.configuration.xml.reload" value="false" />
|
||||
<constant name="struts.custom.i18n.resources" value="globalMessages" />
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
<constant name="struts.serve.static.browserCache" value="false" />
|
||||
|
||||
<include file="struts-chat.xml" />
|
||||
|
||||
<include file="struts-interactive.xml" />
|
||||
|
||||
<include file="struts-hangman.xml" />
|
||||
|
||||
<include file="struts-continuations.xml"/>
|
||||
|
||||
<include file="struts-tags.xml"/>
|
||||
|
||||
<include file="struts-validation.xml" />
|
||||
@@ -61,7 +61,7 @@
|
||||
<interceptor-stack name="crudStack">
|
||||
<interceptor-ref name="checkbox" />
|
||||
<interceptor-ref name="params" />
|
||||
<interceptor-ref name="staticParams" />
|
||||
<interceptor-ref name="static-params" />
|
||||
<interceptor-ref name="defaultStack" />
|
||||
</interceptor-stack>
|
||||
</interceptors>
|
||||
@@ -110,7 +110,7 @@
|
||||
<interceptor-ref name="basicStack"/>
|
||||
</action>
|
||||
<action name="edit-*" class="org.apache.struts2.showcase.action.EmployeeAction">
|
||||
<param name="empId">{1}</param>
|
||||
<param name="empId">{1}</param>
|
||||
<result>/empmanager/editEmployee.jsp</result>
|
||||
<interceptor-ref name="crudStack"><param name="validation.excludeMethods">execute</param></interceptor-ref>
|
||||
</action>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
response.setHeader("Pragma", "no-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setDateHeader("Expires", 0);
|
||||
|
||||
|
||||
// Calculate the view sources url
|
||||
String sourceUrl = request.getContextPath()+"/viewSource.action";
|
||||
com.opensymphony.xwork2.ActionInvocation inv = com.opensymphony.xwork2.ActionContext.getContext().getActionInvocation();
|
||||
@@ -14,9 +14,9 @@
|
||||
com.opensymphony.xwork2.util.location.Location loc = inv.getProxy().getConfig().getLocation();
|
||||
sourceUrl += "?config="+(loc != null ? loc.getURI()+":"+loc.getLineNumber() : "");
|
||||
sourceUrl += "&className="+inv.getProxy().getConfig().getClassName();
|
||||
|
||||
|
||||
if (inv.getResult() != null && inv.getResult() instanceof org.apache.struts2.dispatcher.StrutsResultSupport) {
|
||||
sourceUrl += "&page="+mapping.getNamespace()+"/"+((org.apache.struts2.dispatcher.StrutsResultSupport)inv.getResult()).getLastFinalLocation();
|
||||
sourceUrl += "&page="+mapping.getNamespace()+"/"+((org.apache.struts2.dispatcher.StrutsResultSupport)inv.getResult()).getLastFinalLocation();
|
||||
}
|
||||
} else {
|
||||
sourceUrl += "?page="+request.getServletPath();
|
||||
@@ -30,6 +30,23 @@
|
||||
<head>
|
||||
<title><decorator:title default="Struts Showcase"/></title>
|
||||
<link href="<s:url value='/styles/main.css' encode='false' includeParams='none'/>" rel="stylesheet" type="text/css" media="all"/>
|
||||
<link href="<s:url value='/struts/niftycorners/niftyCorners.css' encode='false' includeParams='none'/>" rel="stylesheet" type="text/css"/>
|
||||
<link href="<s:url value='/struts/niftycorners/niftyPrint.css' encode='false' includeParams='none'/>" rel="stylesheet" type="text/css" media="print"/>
|
||||
|
||||
<script language="JavaScript" type="text/javascript" src="<s:url value='/struts/niftycorners/nifty.js' encode='false' includeParams='none'/>"></script>
|
||||
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
|
||||
window.onload=function(){
|
||||
if(!NiftyCheck())
|
||||
return;
|
||||
Rounded("blockquote","tr bl","#ECF1F9","#CDFFAA","smooth border #88D84F");
|
||||
Rounded("div#outer-header", "all", "white", "#818EBD", "smooth border #434F7C");
|
||||
Rounded("div#footer", "all", "white", "#818EBD", "smooth border #434F7C");
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<decorator:head/>
|
||||
</head>
|
||||
|
||||
@@ -41,7 +58,7 @@
|
||||
<div id="header" class="clearfix">
|
||||
<div id="branding">
|
||||
<h1 class="title">Struts Showcase</h1>
|
||||
<s:action var="dateAction" name="date" namespace="/" executeResult="true" />
|
||||
<s:action id="dateAction" name="date" namespace="/" executeResult="true" />
|
||||
</div><!-- end branding -->
|
||||
|
||||
<div id="search">
|
||||
@@ -78,7 +95,6 @@
|
||||
<li><a href="<s:url value="/tiles/index.action" />">Tiles</a></li>
|
||||
<li><a href="<s:url value="/token/index.jsp"/>">Token</a></li>
|
||||
<li><a href="<s:url value="/validation/index.jsp"/>">Validation</a></li>
|
||||
<li><a href="<s:url value="/interactive/index.jsp"/>">Interactive Demo</a></li>
|
||||
<li class="last"><a href="<s:url value="/help.jsp"/>">Help</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -88,11 +104,11 @@
|
||||
|
||||
</div><!-- end content -->
|
||||
|
||||
<div>
|
||||
<p>
|
||||
<a href="<%=sourceUrl %>">View Sources</a>
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<p>
|
||||
<a href="<%=sourceUrl %>">View Sources</a>
|
||||
</p>
|
||||
</div>
|
||||
<div id="footer" class="clearfix">
|
||||
<p>Copyright © 2003-<s:property value="#dateAction.now.year + 1900" /> The Apache Software Foundation.</p>
|
||||
</div><!-- end footer -->
|
||||
|
||||
@@ -28,21 +28,15 @@
|
||||
<tiles-definitions>
|
||||
|
||||
<definition name="showcase.index" template="/tiles/layout.jsp">
|
||||
<put-attribute name="title" value="Tiles Showcase"/>
|
||||
<put-attribute name="header" value="/tiles/header.jsp"/>
|
||||
<put-attribute name="body" value="/tiles/body.jsp"/>
|
||||
<put name="title" value="Tiles Showcase"/>
|
||||
<put name="header" value="/tiles/header.jsp"/>
|
||||
<put name="body" value="/tiles/body.jsp"/>
|
||||
</definition>
|
||||
|
||||
<definition name="showcase.freemarker" template="/tiles/layout.jsp">
|
||||
<put-attribute name="title" value="Tiles/Freemarker Showcase"/>
|
||||
<put-attribute name="header" value="/tiles/header.jsp"/>
|
||||
<put-attribute name="body" value="/tiles/body.ftl"/>
|
||||
</definition>
|
||||
|
||||
<definition name="showcase.freemarkerLayout" template="/tiles/layout.ftl">
|
||||
<put-attribute name="title" value="Tiles/Freemarker Showcase"/>
|
||||
<put-attribute name="header" value="/tiles/header.jsp"/>
|
||||
<put-attribute name="body" value="/tiles/body.ftl"/>
|
||||
<put name="title" value="Tiles/Freemarker Showcase"/>
|
||||
<put name="header" value="/tiles/header.jsp"/>
|
||||
<put name="body" value="/tiles/body.ftl"/>
|
||||
</definition>
|
||||
|
||||
</tiles-definitions>
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
|
||||
|
||||
<display-name>Struts Showcase Application</display-name>
|
||||
|
||||
<context-param>
|
||||
<param-name>org.apache.tiles.CONTAINER_FACTORY</param-name>
|
||||
<param-value>org.apache.struts2.tiles.StrutsTilesContainerFactory</param-value>
|
||||
</context-param>
|
||||
|
||||
<filter>
|
||||
<filter-name>struts-cleanup</filter-name>
|
||||
@@ -52,7 +57,7 @@
|
||||
|
||||
<listener>
|
||||
<listener-class>
|
||||
org.apache.struts2.tiles.StrutsTilesListener
|
||||
org.apache.tiles.listener.TilesListener
|
||||
</listener-class>
|
||||
</listener>
|
||||
|
||||
@@ -80,12 +85,6 @@
|
||||
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
<servlet>
|
||||
<servlet-name>JspSupportServlet</servlet-name>
|
||||
<servlet-class>org.apache.struts2.views.JspSupportServlet</servlet-class>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
|
||||
<!-- JavaServer Faces Servlet Mapping, not called directly -->
|
||||
<servlet-mapping>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Ajax Examples</title>
|
||||
@@ -10,153 +9,74 @@
|
||||
<!--// END SNIPPET: common-include-->
|
||||
</head>
|
||||
|
||||
<script type="text/javascript">
|
||||
dojo.event.topic.subscribe("/before", function(event, widget){
|
||||
alert('inside a topic event. before request');
|
||||
//event: set event.cancel = true, to cancel request
|
||||
//widget: widget that published the topic
|
||||
});
|
||||
|
||||
dojo.event.topic.subscribe("/after", function(data, request, widget){
|
||||
alert('inside a topic event. after request');
|
||||
//data : json object from request
|
||||
//request: XMLHttpRequest object
|
||||
//widget: widget that published the topic
|
||||
});
|
||||
|
||||
dojo.event.topic.subscribe("/value", function(error, request, widget){
|
||||
alert('inside a topic event. on error');
|
||||
//error : error object (error.message has the error message)
|
||||
//request: XMLHttpRequest object
|
||||
//widget: widget that published the topic
|
||||
});
|
||||
|
||||
function showKey() {
|
||||
var autoCompleter = dojo.widget.byId('jsauto');
|
||||
alert(autoCompleter.getSelectedKey());
|
||||
}
|
||||
|
||||
function showValue() {
|
||||
var autoCompleter = dojo.widget.byId('jsauto');
|
||||
alert(autoCompleter.getSelectedValue());
|
||||
}
|
||||
</script>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
<s:url var="jsonList" value="/JSONList.action"/>
|
||||
<s:url id="jsonList" value="/JSONList.action"/>
|
||||
|
||||
Using a JSON list returned from an action (href="/JSONList.action"), without autoComplete (autoComplete="false"), use indicator, search substring (searchType="substring")
|
||||
<br/>
|
||||
<sx:autocompleter
|
||||
indicator="indicator1"
|
||||
href="%{jsonList}"
|
||||
cssStyle="width: 200px;"
|
||||
autoComplete="false"
|
||||
searchType="substring"
|
||||
name="state"/>
|
||||
<s:autocompleter name="state" theme="ajax" indicator="indicator1" href="%{jsonList}" cssStyle="width: 200px;" autoComplete="false" searchType="substring"/>
|
||||
<img id="indicator1" src="${pageContext.request.contextPath}/images/indicator.gif" alt="Loading..." style="display:none"/>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
Reload on type (loadOnTextChange="true"), after 3 characters (loadMinimumCount="3", it is "3" by default), without the down arrow button (showDownArrow="false")
|
||||
<br/>
|
||||
<sx:autocompleter
|
||||
id="auto2"
|
||||
indicator="indicator"
|
||||
href="%{jsonList}"
|
||||
cssStyle="width: 200px;"
|
||||
autoComplete="false"
|
||||
loadOnTextChange="true"
|
||||
loadMinimumCount="3"
|
||||
showDownArrow="false"/>
|
||||
<br/>
|
||||
|
||||
Reload on type (loadOnTextChange="true"), after 3 characters (loadMinimumCout="3", it is "3" by default), without the down arrow button (showDownArrow="false")
|
||||
<br/>
|
||||
<s:autocompleter name="state" theme="ajax" indicator="indicator" href="%{jsonList}" cssStyle="width: 200px;" autoComplete="false" loadOnTextChange="true" loadMinimumCount="3" showDownArrow="false"/>
|
||||
<img id="indicator" src="${pageContext.request.contextPath}/images/indicator.gif" alt="Loading..." style="display:none"/>
|
||||
|
||||
<br/><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
Using a JSON list returned from an action (href="/JSONList.action"), with autoComplete (autoComplete="true")
|
||||
<br/>
|
||||
<sx:autocompleter
|
||||
href="%{#jsonList}"
|
||||
cssStyle="width: 200px;"
|
||||
autoComplete="true" />
|
||||
<s:autocompleter theme="ajax" href="%{jsonList}" cssStyle="width: 200px;" autoComplete="true" />
|
||||
|
||||
<br/><br/>
|
||||
|
||||
Using a local list (list="%{'apple','banana','grape','pear'}")
|
||||
<br/>
|
||||
<sx:autocompleter list="{'apple','banana','grape','pear'}" cssStyle="width: 150px;"/>
|
||||
<br/>
|
||||
|
||||
<br/><br/>
|
||||
Using a local list (list="{'apple','banana','grape','pear'}")
|
||||
<br/>
|
||||
<s:autocompleter theme="simple" list="{'apple','banana','grape','pear'}" cssStyle="width: 150px;"/>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
Force valid options (forceValidOption="true")
|
||||
<br/>
|
||||
<sx:autocompleter href="%{#jsonList}" cssStyle="width: 200px;" forceValidOption="true"/>
|
||||
<s:autocompleter theme="ajax" href="%{jsonList}" cssStyle="width: 200px;" forceValidOption="true"/>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
Make dropdown's height to 180px (dropdownHeight="180")
|
||||
<br/>
|
||||
<sx:autocompleter href="%{#jsonList}" cssStyle="width: 200px;" dropdownHeight="180"/>
|
||||
<s:autocompleter theme="ajax" href="%{jsonList}" cssStyle="width: 200px;" dropdownHeight="180"/>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
Disabled combobox (disabled="true")
|
||||
<br/>
|
||||
<sx:autocompleter href="%{#jsonList}" cssStyle="width: 200px;" disabled="true"/>
|
||||
<s:autocompleter theme="ajax" href="%{jsonList}" cssStyle="width: 200px;" disabled="true"/>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<s:url var="autoex" action="AutocompleterExample" namespace="/nodecorate"/>
|
||||
<s:url id="autoex" action="AutocompleterExample" namespace="/nodecorate"/>
|
||||
|
||||
Link two autocompleter elements. When the selected value in 'Autocompleter 1' changes, the available values in 'Autocompleter 2' will change also.
|
||||
<br/>
|
||||
<form id="selectForm">
|
||||
<p>
|
||||
Autocompleter 1
|
||||
<sx:autocompleter
|
||||
name="select"
|
||||
list="{'fruits','colors'}"
|
||||
value="colors"
|
||||
valueNotifyTopics="/Changed"
|
||||
forceValidOption="true"/>
|
||||
</p>
|
||||
<p>Autocompleter 1 <s:autocompleter theme="simple" name="select" list="{'fruits','colors'}" value="colors" notifyTopics="/Changed" forceValidOption="true" id="sel"/></p>
|
||||
</form>
|
||||
Autocompleter 2
|
||||
<sx:autocompleter
|
||||
href="%{#autoex}"
|
||||
autoComplete="false"
|
||||
formId="selectForm"
|
||||
listenTopics="/Changed"
|
||||
forceValidOption="true" />
|
||||
Autocompleter 2 <s:autocompleter theme="ajax" href="%{#autoex}" autoComplete="false" formId="selectForm" listenTopics="/Changed" forceValidOption="true" id="ops"/>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
Publish before/after/value notify topics
|
||||
<br/>
|
||||
<sx:autocompleter
|
||||
href="%{#jsonList}"
|
||||
listenTopics="/reload"
|
||||
beforeNotifyTopics="/before"
|
||||
afterNotifyTopics="/after"
|
||||
valueNotifyTopics="/value"
|
||||
cssStyle="width: 200px;" />
|
||||
<s:submit theme="simple" value="Reload Values" onclick="dojo.event.topic.publish('/reload')"/>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
Get values using JavaScript
|
||||
<br/>
|
||||
<sx:autocompleter href="%{#jsonList}" id="jsauto" name="state"/>
|
||||
<s:submit theme="simple" value="Show Key" onclick="showKey()"/>
|
||||
<s:submit theme="simple" value="Show Value" onclick="showValue()"/>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<s:include value="../footer.jsp"/>
|
||||
</body>
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Bind Examples</title>
|
||||
<jsp:include page="/ajax/commonInclude.jsp"/>
|
||||
</head>
|
||||
|
||||
<script type="text/javascript">
|
||||
dojo.event.topic.subscribe("/before", function(event, widget){
|
||||
alert('inside a topic event. before request');
|
||||
//event: set event.cancel = true, to cancel request
|
||||
//widget: widget that published the topic
|
||||
});
|
||||
|
||||
dojo.event.topic.subscribe("/after", function(data, request, widget){
|
||||
alert('inside a topic event. after request');
|
||||
//data : text returned from request
|
||||
//request: XMLHttpRequest object
|
||||
//widget: widget that published the topic
|
||||
});
|
||||
</script>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="div1">Div 1</div>
|
||||
<s:url var="ajaxTest" value="/AjaxTest.action" />
|
||||
|
||||
|
||||
<br/><br/>
|
||||
<p>
|
||||
1. Attach to "onclick" event on button. Update content of Div 1. Use with indicator.
|
||||
<img id="indicator" src="${pageContext.request.contextPath}/images/indicator.gif" alt="Loading..." style="display:none"/>
|
||||
<sx:bind href="%{#ajaxTest}" sources="button" targets="div1" events="onclick" indicator="indicator" />
|
||||
<br/>
|
||||
<s:submit theme="simple" type="submit" value="submit" id="button"/>
|
||||
</p>
|
||||
<br/><br/>
|
||||
<p>
|
||||
2. Attach to "onmouseover", and "onclick" event on Area below and update content of Div1, highlight targets with green color
|
||||
<sx:bind id="ex2" href="%{#ajaxTest}" sources="div2" targets="div1" events="onmouseover,onclick" highlightColor="green"/>
|
||||
<div id="div2" style="width: 300px; height: 50px; border: 1px solid black">
|
||||
Mouse Over or Click Here!
|
||||
</div>
|
||||
</p>
|
||||
<br/><br/>
|
||||
<p>
|
||||
3. Attach to "onkeydown" event on Textbox below update content of Div1. Publish topics.
|
||||
<sx:bind id="ex4" href="%{#ajaxTest}" sources="txt1" targets="div1" events="onkeydown" beforeNotifyTopics="/before" afterNotifyTopics="/after" />
|
||||
<br/>
|
||||
<s:textfield id="txt1"/>
|
||||
</p>
|
||||
|
||||
|
||||
<br/><br/>
|
||||
<s:include value="../footer.jsp"/>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,5 +1,4 @@
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
<!--// START SNIPPET: common-include-->
|
||||
<sx:head cache="true"/>
|
||||
<s:head theme="ajax"/>
|
||||
<!--// END SNIPPET: common-include-->
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<hr/>
|
||||
|
||||
<s:url var="backToAjaxExamples" value=".." />
|
||||
<s:url id="backToAjaxExamples" value=".." />
|
||||
|
||||
<s:a href="%{backToAjaxExamples}">Back To AJAX Examples</s:a>
|
||||
|
||||
|
||||
@@ -10,15 +10,14 @@ Note: The Ajax tags are experimental. These examples have only been tested under
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="bind/index.jsp">Bind tag</a></li>
|
||||
<li><a href="autocompleter/index.jsp">Autocompleter combobox tag</a></li>
|
||||
<li><a href="remotebutton/index.jsp">Remote button tag</a></li>
|
||||
<li><a href="remotediv/index.jsp">Remote div tag</a></li>
|
||||
<li><a href="remotelink/index.jsp">Remote link tag</a></li>
|
||||
<li><a href="tabbedpanel/index.jsp">Tabbed panel</a></li>
|
||||
<li><a href="remoteforms/index.jsp">Remote forms</a></li>
|
||||
<li><a href="widgets/index.jsp">Widgets </a> (may not work in all browsers!)
|
||||
<li><a href="autocompleter">Autocompleter combobox tag</a></li>
|
||||
<li><a href="remotebutton">Remote button tag</a></li>
|
||||
<li><a href="remotediv">Remote div tag</a></li>
|
||||
<li><a href="remotelink">Remote link tag</a></li>
|
||||
<li><a href="tabbedpanel">Tabbed panel</a></li>
|
||||
<li><a href="widgets">Widgets </a> (may not work in all browsers!)
|
||||
see the <a href="http://www.dojotoolkit.org">dojo website</a> for more information</li>
|
||||
<li><a href="remoteforms">Remote forms</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
@@ -13,10 +12,10 @@
|
||||
function after() {alert("after request");}
|
||||
function handler(widget, node) {
|
||||
alert('I will handle this myself!');
|
||||
dojo.byId(widget.targetsArray[0]).innerHTML = "Done";
|
||||
dojo.byId(widget.targetsArray[0]).innerHTML = "Done";
|
||||
}
|
||||
|
||||
dojo.event.topic.subscribe("/alltopics", function(data, type, e){
|
||||
dojo.event.topic.subscribe("/after", function(data, type, e){
|
||||
alert('inside a topic event. type='+type);
|
||||
//data : text returned
|
||||
//type : "before", "load" or "error"
|
||||
@@ -27,30 +26,26 @@
|
||||
<body>
|
||||
|
||||
<div id="t1">Div 1</div>
|
||||
<s:url var="ajaxTest" value="/AjaxTest.action" />
|
||||
<s:url id="ajaxTest" value="/AjaxTest.action" />
|
||||
|
||||
<br/><br/>
|
||||
|
||||
A submit button, that highlights (blue color) its targets
|
||||
<sx:submit type="submit" value="submit" targets="t1" href="%{ajaxTest}" highlightColor="blue"/>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
A submit button, with an indicator
|
||||
<img id="indicator" src="${pageContext.request.contextPath}/images/indicator.gif" alt="Loading..." style="display:none"/>
|
||||
<sx:submit id="submit2" type="submit" value="submit" targets="t1" href="%{ajaxTest}" indicator="indicator"/>
|
||||
<s:submit type="submit" theme="ajax" value="submit" targets="t1" href="%{ajaxTest}" align="left" indicator="indicator"/>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
A submit button, with "notifyTopics"
|
||||
<sx:submit type="submit" value="submit" targets="t1" href="%{ajaxTest}" notifyTopics="/alltopics"/>
|
||||
<s:submit type="submit" theme="ajax" value="submit" targets="t1" href="%{ajaxTest}" align="left" notifyTopics="/after"/>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
Use an image as submit
|
||||
|
||||
<sx:submit type="image" label="Alt Text" targets="t1"
|
||||
src="${pageContext.request.contextPath}/images/struts-power.gif" href="%{ajaxTest}" />
|
||||
<s:submit type="image" theme="ajax" label="Alt Text" targets="t1"
|
||||
src="${pageContext.request.contextPath}/images/struts-power.gif" href="%{ajaxTest}" align="left" />
|
||||
<br/><br/>
|
||||
|
||||
<label for="textInput">Text to be echoed</label>
|
||||
@@ -59,7 +54,7 @@ Use an image as submit
|
||||
Use a button as submit (custom text)
|
||||
<s:form id="form" action="AjaxTest">
|
||||
<input type=textbox name="data">
|
||||
<sx:submit type="button" label="Update Content" targets="t1" id="ajaxbtn"/>
|
||||
<s:submit type="button" theme="ajax" label="Update Content" targets="t1" id="ajaxbtn"/>
|
||||
</s:form>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
@@ -8,14 +7,16 @@
|
||||
<jsp:include page="/ajax/commonInclude.jsp"/>
|
||||
</head>
|
||||
|
||||
<s:url var="ajaxTest" value="/AjaxTest.action" />
|
||||
<s:url id="ajaxTest" value="/AjaxTest.action" />
|
||||
|
||||
|
||||
<body>
|
||||
<sx:div
|
||||
<s:div
|
||||
id="once"
|
||||
theme="ajax"
|
||||
cssStyle="border: 1px solid yellow;"
|
||||
href="%{ajaxTest}">
|
||||
Initial Content</sx:div>
|
||||
Initial Content</s:div>
|
||||
|
||||
<s:include value="../footer.jsp"/>
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
@@ -15,15 +14,16 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<s:url var="ajaxTest" value="/AjaxTest.action" />
|
||||
<s:url id="ajaxTest" value="/AjaxTest.action" />
|
||||
|
||||
<body>
|
||||
<sx:div
|
||||
<s:div
|
||||
id="once"
|
||||
theme="ajax"
|
||||
cssStyle="border: 1px solid yellow;"
|
||||
href="%{ajaxTest}"
|
||||
handler="handler">
|
||||
Initial Content</sx:div>
|
||||
Initial Content</s:div>
|
||||
|
||||
<s:include value="../footer.jsp"/>
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
@@ -10,17 +9,18 @@
|
||||
|
||||
|
||||
<body>
|
||||
<s:url var="ajaxTest" value="/AjaxTest.action" />
|
||||
<s:url id="ajaxTest" value="/AjaxTest.action" />
|
||||
|
||||
|
||||
<sx:div
|
||||
<s:div
|
||||
id="once"
|
||||
theme="ajax"
|
||||
cssStyle="border: 1px solid yellow;"
|
||||
href="%{#ajaxTest}"
|
||||
href="%{ajaxTest}"
|
||||
updateFreq="2000"
|
||||
indicator="indicator"
|
||||
>
|
||||
Initial Content</sx:div>
|
||||
Initial Content</s:div>
|
||||
<img id="indicator" src="${pageContext.request.contextPath}/images/indicator.gif" alt="Loading..." style="display:none"/>
|
||||
<s:include value="../footer.jsp"/>
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
@@ -10,16 +9,17 @@
|
||||
|
||||
<body>
|
||||
|
||||
<s:url var="ajaxTest" value="/AjaxTest.action" />
|
||||
<s:url id="ajaxTest" value="/AjaxTest.action" />
|
||||
|
||||
|
||||
<sx:div
|
||||
<s:div
|
||||
id="twoseconds"
|
||||
cssStyle="border: 1px solid yellow;"
|
||||
href="%{ajaxTest}"
|
||||
theme="ajax"
|
||||
delay="2000"
|
||||
updateFreq="%{#parameters.period}"
|
||||
errorText="There was an error">Initial Content</sx:div>
|
||||
errorText="There was an error">Initial Content</s:div>
|
||||
|
||||
<s:include value="../footer.jsp"/>
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
@@ -10,17 +9,17 @@
|
||||
|
||||
<body>
|
||||
|
||||
<s:url var="ajaxTest" value="/AjaxTest.action" />
|
||||
<s:url id="ajaxTest" value="/AjaxTest.action" />
|
||||
|
||||
<sx:div
|
||||
<s:div
|
||||
id="fiveseconds"
|
||||
cssStyle="border: 1px solid yellow;"
|
||||
href="%{ajaxTest}"
|
||||
theme="ajax"
|
||||
delay="1000"
|
||||
updateFreq="5000"
|
||||
errorText="There was an error"
|
||||
loadingText="reloading"
|
||||
showLoadingText="true">loading now</sx:div>
|
||||
loadingText="reloading">loading now</s:div>
|
||||
|
||||
<s:include value="../footer.jsp"/>
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
@@ -10,15 +9,16 @@
|
||||
|
||||
<body>
|
||||
|
||||
<s:url var="ajaxNoUrl" value="/AjaxNoUrl.jsp" />
|
||||
<s:url id="ajaxNoUrl" value="/AjaxNoUrl.jsp" />
|
||||
|
||||
<sx:div
|
||||
<s:div
|
||||
id="error"
|
||||
cssStyle="border: 1px solid yellow;"
|
||||
href="/AjaxNoUrl.jsp"
|
||||
theme="ajax"
|
||||
delay="1000"
|
||||
errorText="Could not contact server"
|
||||
loadingText="reloading">loading now</sx:div>
|
||||
loadingText="reloading">loading now</s:div>
|
||||
|
||||
|
||||
<s:include value="../footer.jsp"/>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
@@ -10,13 +9,14 @@
|
||||
|
||||
<body>
|
||||
|
||||
<sx:div
|
||||
<s:div
|
||||
id="error"
|
||||
cssStyle="border: 1px solid yellow;"
|
||||
href="/AjaxNoUrl.jsp"
|
||||
theme="ajax"
|
||||
delay="1000"
|
||||
showErrorTransportText="true"
|
||||
loadingText="reloading">loading now</sx:div>
|
||||
loadingText="reloading">loading now</s:div>
|
||||
|
||||
<s:include value="../footer.jsp"/>
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
@@ -10,16 +9,17 @@
|
||||
|
||||
<body>
|
||||
|
||||
<s:url var="test3" value="/Test3.action" />
|
||||
<s:url id="test3" value="/Test3.action" />
|
||||
|
||||
|
||||
<sx:div
|
||||
<s:div
|
||||
id="error"
|
||||
cssStyle="border: 1px solid yellow;"
|
||||
href="%{test3}"
|
||||
theme="ajax"
|
||||
delay="1000"
|
||||
executeScripts="true"
|
||||
loadingText="reloading">loading now</sx:div>
|
||||
loadingText="reloading">loading now</s:div>
|
||||
|
||||
<s:include value="../footer.jsp"/>
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
@@ -34,10 +33,11 @@
|
||||
<input type=button value="stop timer" onclick="controller.stop()">
|
||||
<input type=button value="start timer" onclick="controller.start()">
|
||||
|
||||
<s:url var="ajaxTest" value="/AjaxTest.action" />
|
||||
<s:url id="ajaxTest" value="/AjaxTest.action" />
|
||||
|
||||
<sx:div
|
||||
<s:div
|
||||
id="once"
|
||||
theme="ajax"
|
||||
cssStyle="border: 1px solid yellow;"
|
||||
href="%{ajaxTest}"
|
||||
loadingText="Loading..."
|
||||
@@ -46,10 +46,9 @@
|
||||
stopTimerListenTopics="/stopTimer"
|
||||
updateFreq="3000"
|
||||
autoStart="true"
|
||||
highlightColor="red"
|
||||
formId="form"
|
||||
>
|
||||
Initial Content</sx:div>
|
||||
Initial Content</s:div>
|
||||
|
||||
<s:include value="../footer.jsp"/>
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
@@ -21,18 +20,11 @@
|
||||
dojo.event.topic.registerPublisher("/startTimer", controller, "start");
|
||||
dojo.event.topic.registerPublisher("/stopTimer", controller, "stop");
|
||||
|
||||
dojo.event.topic.subscribe("/before", function(data, type, e){
|
||||
alert('inside a topic event. before request');
|
||||
//data : source element id
|
||||
//type : "before"
|
||||
//e : request object
|
||||
});
|
||||
|
||||
dojo.event.topic.subscribe("/after", function(data, type, e){
|
||||
alert('inside a topic event. after request');
|
||||
alert('inside a topic event. type='+type);
|
||||
//data : text returned
|
||||
//type : "load"
|
||||
//e : undefined
|
||||
//type : "before", "load" or "error"
|
||||
//e : request object
|
||||
});
|
||||
|
||||
</script>
|
||||
@@ -41,10 +33,11 @@
|
||||
<input type=button value="start timer" onclick="controller.start()">
|
||||
<input type=button value="stop timer" onclick="controller.stop()">
|
||||
|
||||
<s:url var="ajaxTest" value="/AjaxTest.action" />
|
||||
<s:url id="ajaxTest" value="/AjaxTest.action" />
|
||||
|
||||
<sx:div
|
||||
id="div1"
|
||||
<s:div
|
||||
id="once"
|
||||
theme="ajax"
|
||||
cssStyle="border: 1px solid yellow;"
|
||||
href="%{ajaxTest}"
|
||||
listenTopics="/refresh"
|
||||
@@ -52,10 +45,10 @@
|
||||
stopTimerListenTopics="/stopTimer"
|
||||
updateFreq="10000"
|
||||
autoStart="false"
|
||||
beforeNotifyTopics="/before"
|
||||
afterNotifyTopics="/after"
|
||||
afterLoading="alert('after request')"
|
||||
notifyTopics="/after"
|
||||
>
|
||||
Initial Content</sx:div>
|
||||
Initial Content</s:div>
|
||||
|
||||
<s:include value="../footer.jsp"/>
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="example8.jsp">A div that will listen to events to refresh and start/stop autoupdate, and gets highlighted in red (when it loads)</a>
|
||||
<a href="example8.jsp">A div that will listen to events to refresh and start/stop autoupdate</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
@@ -1,117 +1,107 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Ajax Examples</title>
|
||||
<sx:head />
|
||||
<s:head theme="ajax"/>
|
||||
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
dojo.event.topic.subscribe("/beforeSubmit", function(event, widget) {
|
||||
alert('you can manipulate the form before it gets submitted. To cancel the submit event set event.cancel=true');
|
||||
event.cancel = true;
|
||||
});
|
||||
function doSomething() {
|
||||
alert('you can manipulate the form before it gets submitted');
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id='two' style="border: 1px solid yellow;"><b>initial content</b></div>
|
||||
|
||||
|
||||
<br /><br />
|
||||
Remote form replacing another div:<br/>
|
||||
|
||||
<div id='two' style="border: 1px solid yellow;"><b>initial content</b></div>
|
||||
<s:form
|
||||
id='theForm2'
|
||||
cssStyle="border: 1px solid green;"
|
||||
action='AjaxRemoteForm'
|
||||
method='post'>
|
||||
method='post'
|
||||
theme="ajax">
|
||||
|
||||
<input type='text' name='data' value='Struts User'>
|
||||
|
||||
<sx:submit value="GO2" targets="two"/>
|
||||
<s:submit value="GO2" theme="ajax" targets="two"/>
|
||||
|
||||
</s:form>
|
||||
|
||||
<br /><br />
|
||||
|
||||
Remote form replacing the forms content:<br/>
|
||||
<s:form
|
||||
id='theForm3'
|
||||
cssStyle="border: 1px solid green;"
|
||||
action='AjaxRemoteForm'
|
||||
method='post'>
|
||||
method='post'
|
||||
theme="ajax">
|
||||
|
||||
<input type='text' name='data' value='Struts User'>
|
||||
|
||||
<sx:submit value="GO3" targets="theForm3"/>
|
||||
<s:submit value="GO3" theme="ajax" targets="theForm3"/>
|
||||
|
||||
</s:form>
|
||||
|
||||
<br /><br />
|
||||
Remote form evaluating suplied JS on completion:<br/>
|
||||
<s:form
|
||||
id='theForm4'
|
||||
cssStyle="border: 1px solid green;"
|
||||
action='Test3'
|
||||
method='post'>
|
||||
action='AjaxRemoteForm'
|
||||
method='post'
|
||||
theme="ajax">
|
||||
|
||||
<input type='text' name='data' value='Struts User'>
|
||||
|
||||
<sx:submit value="GO4" executeScripts="true"/>
|
||||
<s:submit value="GO4" theme="ajax"/>
|
||||
|
||||
</s:form>
|
||||
|
||||
<br /><br />
|
||||
Submit outside form:<br/>
|
||||
Remote form replacing the forms content after confirming results:<br/>
|
||||
<s:form
|
||||
id='theForm5'
|
||||
cssStyle="border: 1px solid green;"
|
||||
action='AjaxRemoteForm'
|
||||
method='post'>
|
||||
method='post'
|
||||
theme="ajax">
|
||||
|
||||
<input type='text' name='data' value='Struts User'>
|
||||
</s:form>
|
||||
<sx:submit value="GO5" formId="theForm5" targets="two"/>
|
||||
|
||||
<br /><br />
|
||||
<s:url var="remoteUrl" namespace="/remoteforms" action="AjaxRemoteForm"/>
|
||||
Submit outside form, href in submit tag:<br/>
|
||||
<s:submit value="GO3" theme="ajax" targets="theForm5" />
|
||||
|
||||
</s:form>
|
||||
|
||||
Remote form replacing the forms content after running a function:<br/>
|
||||
<s:form
|
||||
id='theForm6'
|
||||
cssStyle="border: 1px solid green;"
|
||||
method='post'>
|
||||
action='AjaxRemoteForm'
|
||||
method='post'
|
||||
theme="ajax">
|
||||
|
||||
<input type='text' name='data' value='Struts User'>
|
||||
</s:form>
|
||||
<sx:submit value="GO6" formId="theForm6" targets="two" href="%{#remoteUrl}"/>
|
||||
|
||||
<br /><br />
|
||||
Remote form whose submit is cancelled:<br/>
|
||||
<s:submit value="GO3" theme="ajax" targets="theForm6" />
|
||||
|
||||
</s:form>
|
||||
|
||||
A form with no remote submit (so should not be ajaxified):<br/>
|
||||
<s:form
|
||||
id='theForm7'
|
||||
cssStyle="border: 1px solid green;"
|
||||
action='AjaxRemoteForm'
|
||||
method='post'>
|
||||
method='post'
|
||||
theme="ajax">
|
||||
|
||||
<input type='text' name='data' value='Struts User'>
|
||||
|
||||
<sx:submit value="GO7" targets="theForm7" beforeNotifyTopics="/beforeSubmit"/>
|
||||
|
||||
</s:form>
|
||||
|
||||
<br /><br />
|
||||
A form with no remote submit (so should not be ajaxified):<br/>
|
||||
<s:form
|
||||
id='theForm8'
|
||||
cssStyle="border: 1px solid green;"
|
||||
action='AjaxRemoteForm'
|
||||
method='post'>
|
||||
|
||||
<input type='text' name='data' value='Struts User'>
|
||||
|
||||
<s:submit value="Go AWAY" />
|
||||
<s:submit value="Go AWAY" targets="theForm7" />
|
||||
|
||||
</s:form>
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<s:head theme="ajax"/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<s:form name="test1" id="test1" action="/ajax/Test1.action" theme="ajax">
|
||||
Test 1 Form
|
||||
<s:submit theme="ajax" targets="result2"/>
|
||||
</s:form>
|
||||
|
||||
<s:div id="result2" theme="ajax" >test2 - before</s:div>
|
||||
|
||||
<s:div id="result3" theme="ajax">test3 - before</s:div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
|
||||
<s:form name="test2" id="test2" action="/ajax/Test2.action" theme="ajax">
|
||||
Test 2 form
|
||||
<s:submit theme="ajax" targets="result3"/>
|
||||
</s:form>
|
||||
@@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
Test 3 Page
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +1,5 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
@@ -14,30 +13,10 @@
|
||||
dojo.byId(widget.targetsArray[0]).innerHTML = "Done";
|
||||
}
|
||||
|
||||
dojo.event.topic.subscribe("/before", function(event, widget){
|
||||
alert('inside a topic event. before request');
|
||||
//event: set event.cancel = true, to cancel request
|
||||
//widget: widget that published the topic
|
||||
});
|
||||
|
||||
dojo.event.topic.subscribe("/after", function(data, request, widget){
|
||||
alert('inside a topic event. after request');
|
||||
//data : text returned from request
|
||||
//request: XMLHttpRequest object
|
||||
//widget: widget that published the topic
|
||||
});
|
||||
|
||||
dojo.event.topic.subscribe("/error", function(error, request, widget){
|
||||
alert('inside a topic event. on error');
|
||||
//error : error object (error.message has the error message)
|
||||
//request: XMLHttpRequest object
|
||||
//widget: widget that published the topic
|
||||
});
|
||||
|
||||
dojo.event.topic.subscribe("/topics", function(data, type, e){
|
||||
dojo.event.topic.subscribe("/after", function(data, type, e){
|
||||
alert('inside a topic event. type='+type);
|
||||
//data : text returned
|
||||
//type : "before", "load", "error"
|
||||
//type : "before", "load" or "error"
|
||||
//e : request object
|
||||
});
|
||||
</script>
|
||||
@@ -52,54 +31,49 @@
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<s:url var="ajaxTest" value="/AjaxTest.action" />
|
||||
<s:url var="test3" value="/Test3.action" />
|
||||
|
||||
<sx:a
|
||||
href="%{#ajaxTest}"
|
||||
targets="t1"
|
||||
highlightColor="red"
|
||||
highlightDuration="2000">Update 'Div 1' and use red highligh to notify user of changed content</sx:a>
|
||||
<s:url id="ajaxTest" value="/AjaxTest.action" />
|
||||
<s:url id="test3" value="/Test3.action" />
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<sx:a id="link1"
|
||||
href="%{#ajaxTest}"
|
||||
<s:a
|
||||
theme="ajax"
|
||||
href="%{ajaxTest}"
|
||||
indicator="indicator"
|
||||
targets="t1,t2"
|
||||
beforeNotifyTopics="/before"
|
||||
afterNotifyTopics="/after" >Update 'Div 1' and 'Div 2', publish topic '/before' and '/after', use indicator</sx:a>
|
||||
targets="t1,t2" notifyTopics="/after" >Update 'Div 1' and 'Div 2', publish topic '/after', use indicator</s:a>
|
||||
<img id="indicator" src="${pageContext.request.contextPath}/images/indicator.gif" alt="Loading..." style="display:none"/>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<sx:a id="link2"
|
||||
<s:a id="link2"
|
||||
theme="ajax"
|
||||
href="/AjaxNoUrl.jsp"
|
||||
errorText="Error Loading"
|
||||
targets="t1"
|
||||
errorNotifyTopics="/error">Try to update 'Div 1', publish '/error', use custom error message</sx:a>
|
||||
targets="t1">Try to update 'Div 1', use custom error message</s:a>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<sx:a id="link3"
|
||||
href="%{#ajaxTest}"
|
||||
<s:a id="link3"
|
||||
theme="ajax"
|
||||
href="%{ajaxTest}"
|
||||
loadingText="Loading!!!"
|
||||
showLoadingText="true"
|
||||
targets="t1">Update 'Div 1', use custom loading message</sx:a>
|
||||
targets="t1">Update 'Div 1', use custom loading message</s:a>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<sx:a id="link4"
|
||||
href="%{#test3}"
|
||||
<s:a id="link4"
|
||||
theme="ajax"
|
||||
href="%{test3}"
|
||||
executeScripts="true"
|
||||
targets="t2">Update 'Div 2' and execute returned javascript </sx:a>
|
||||
targets="t2">Update 'Div 2' and execute returned javascript </s:a>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<sx:a id="link5"
|
||||
href="%{#ajaxTest}"
|
||||
<s:a id="link5"
|
||||
theme="ajax"
|
||||
href="%{ajaxTest}"
|
||||
handler="handler"
|
||||
targets="t2">Update 'Div 2' using a custom handler </sx:a>
|
||||
targets="t2">Update 'Div 2' using a custom handler </s:a>
|
||||
|
||||
|
||||
<br/><br/>
|
||||
@@ -112,11 +86,12 @@
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<sx:a id="link6"
|
||||
href="%{#ajaxTest}"
|
||||
<s:a id="link6"
|
||||
theme="ajax"
|
||||
href="%{ajaxTest}"
|
||||
targets="t2"
|
||||
formId="form"
|
||||
>Update 'Div 2' with the content of the textbox </sx:a>
|
||||
>Update 'Div 2' with the content of the textbox </s:a>
|
||||
|
||||
|
||||
<br/><br/>
|
||||
|
||||
@@ -1,89 +1,109 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Ajax examples - tabbled panel</title>
|
||||
|
||||
<jsp:include page="/ajax/commonInclude.jsp"/>
|
||||
<link rel="stylesheet" type="text/css" href="<s:url value="/struts/tabs.css"/>">
|
||||
<link rel="stylesheet" type="text/css" href="<s:url value="/struts/niftycorners/niftyCorners.css"/>">
|
||||
<link rel="stylesheet" type="text/css" href="<s:url value="/struts/niftycorners/niftyPrint.css"/>" media="print">
|
||||
<script type="text/javascript" src="<s:url value="/struts/niftycorners/nifty.js"/>"></script>
|
||||
<script type="text/javascript">
|
||||
dojo.event.connect(window, "onload", function() {
|
||||
if (!NiftyCheck())
|
||||
return;
|
||||
Rounded("li.tab_selected", "top", "white", "transparent", "border #ffffffS");
|
||||
Rounded("li.tab_unselected", "top", "white", "transparent", "border #ffffffS");
|
||||
// Rounded("div#tab_header_main li","top","white","transparent","border #ffffffS");
|
||||
// "white" needs to be replaced with the background color
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<s:url var="ajaxTest" value="/AjaxTest.action" />
|
||||
<s:url id="ajaxTest" value="/AjaxTest.action" />
|
||||
|
||||
<body>
|
||||
|
||||
<table cellpadding="0" cellspacing="10" border="0" width="900">
|
||||
<table cellpadding="0" cellspacing="10" border="0" width="600">
|
||||
<tr>
|
||||
<td align="top" width="400">
|
||||
<sx:tabbedpanel id="test" >
|
||||
<sx:div id="one" label="one" >
|
||||
<td align="top">
|
||||
<s:tabbedPanel id="test" >
|
||||
<s:div id="one" label="one" theme="ajax">
|
||||
This is the first pane<br/>
|
||||
<s:form>
|
||||
<s:textfield name="tt" label="Test Text"/> <br/>
|
||||
<s:textfield name="tt2" label="Test Text2"/>
|
||||
</s:form>
|
||||
</sx:div>
|
||||
<sx:div id="two" label="two" >
|
||||
</s:div>
|
||||
<s:div id="two" label="two" theme="ajax">
|
||||
This is the second panel
|
||||
</sx:div>
|
||||
<sx:div id="three" label="three" >
|
||||
</s:div>
|
||||
<s:div id="three" label="three" theme="ajax">
|
||||
This is the three
|
||||
</sx:div>
|
||||
</sx:tabbedpanel>
|
||||
</s:div>
|
||||
</s:tabbedPanel>
|
||||
</td>
|
||||
<td align="top">
|
||||
<sx:tabbedpanel id="test2" >
|
||||
<sx:div id="left" label="left" >
|
||||
<s:tabbedPanel id="test2" >
|
||||
<s:div id="left" label="left" theme="ajax">
|
||||
This is the left pane<br/>
|
||||
<s:form>
|
||||
<s:textfield name="tt" label="Test Text"/> <br/>
|
||||
<s:textfield name="tt2" label="Test Text2"/>
|
||||
</s:form>
|
||||
</sx:div>
|
||||
<sx:div href="%{ajaxTest}" id="ryh1"
|
||||
label="remote one"></sx:div>
|
||||
<sx:div id="middle" label="middle" >
|
||||
</s:div>
|
||||
<s:div href="%{ajaxTest}" id="ryh1" theme="ajax"
|
||||
label="remote one"></s:div>
|
||||
<s:div id="middle" label="middle" theme="ajax">
|
||||
middle tab<br/>
|
||||
<s:form>
|
||||
<s:textfield name="tt" label="Test Text44"/> <br/>
|
||||
<s:textfield name="tt2" label="Test Text442"/>
|
||||
</s:form>
|
||||
</sx:div>
|
||||
<sx:div href="%{ajaxTest}" id="ryh21" label="remote right"/>
|
||||
</sx:tabbedpanel>
|
||||
</s:div>
|
||||
<s:div href="%{ajaxTest}" id="ryh21" theme="ajax" label="remote right"/>
|
||||
</s:tabbedPanel>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="top">
|
||||
<sx:tabbedpanel id="testremote">
|
||||
<sx:div href="%{ajaxTest}" id="r1" label="remote one">
|
||||
<s:tabbedPanel id="testremote">
|
||||
<s:div href="%{ajaxTest}" id="r1" theme="ajax" label="remote one">
|
||||
<s:action name="AjaxTest" executeResult="true" />
|
||||
</sx:div>
|
||||
<sx:div href="%{ajaxTest}" id="r2" label="remote two"></sx:div>
|
||||
<sx:div href="%{ajaxTest}" id="r3" label="remote three"></sx:div>
|
||||
</sx:tabbedpanel>
|
||||
</s:div>
|
||||
<s:div href="%{ajaxTest}" id="r2" theme="ajax" label="remote two"></s:div>
|
||||
<s:div href="%{ajaxTest}" id="r3" theme="ajax" label="remote three"></s:div>
|
||||
</s:tabbedPanel>
|
||||
</td>
|
||||
<td align="top">
|
||||
<sx:tabbedpanel id="test3" >
|
||||
<sx:tabbedpanel id="test11" label="Container 1">
|
||||
<sx:div id="i11" label="inner 1 one">Inner 1</sx:div>
|
||||
<sx:div id="112" label="inner 1 two">Inner 2</sx:div>
|
||||
<sx:div id="i13" label="inner 1 three">Inner 3</sx:div>
|
||||
</sx:tabbedpanel>
|
||||
|
||||
<sx:tabbedpanel id="test12" label="Container 2">
|
||||
<sx:div id="i21" label="inner 2 one" >Inner 21</sx:div>
|
||||
<sx:div id="122" label="inner 2 two" >Inner 22</sx:div>
|
||||
<sx:div id="i23" label="inner 2 three" >Inner 23</sx:div>
|
||||
</sx:tabbedpanel>
|
||||
|
||||
<sx:tabbedpanel id="test13" label="Container 3">
|
||||
<sx:div id="i31" label="inner 3 one" >Inner 31</sx:div>
|
||||
<sx:div id="132" label="inner 3 two" >Inner 32</sx:div>
|
||||
<sx:div id="i33" label="inner 3 three" >Inner 33</sx:div>
|
||||
</sx:tabbedpanel>
|
||||
</sx:tabbedpanel>
|
||||
<s:tabbedPanel id="test3" >
|
||||
<s:div id="left1" label="out one" theme="ajax">
|
||||
Outer one<br/>
|
||||
<s:tabbedPanel id="test11">
|
||||
<s:div id="i11" label="inner 1 one">Inner 1</s:div>
|
||||
<s:div id="112" label="inner 1 two">Inner 2</s:div>
|
||||
<s:div id="i13" label="inner 1 three">Inner 3</s:div>
|
||||
</s:tabbedPanel>
|
||||
</s:div>
|
||||
<s:div id="middle1" label="out two" theme="ajax">
|
||||
Outer two<br/>
|
||||
<s:tabbedPanel id="test12" >
|
||||
<s:div id="i21" label="inner 2 one" theme="ajax">Inner 21</s:div>
|
||||
<s:div id="122" label="inner 2 two" theme="ajax">Inner 22</s:div>
|
||||
<s:div id="i23" label="inner 2 three" theme="ajax">Inner 23</s:div>
|
||||
</s:tabbedPanel>
|
||||
</s:div>
|
||||
<s:div id="right1" label="out three" theme="ajax">
|
||||
Outer three<br/>
|
||||
<s:tabbedPanel id="test13">
|
||||
<s:div id="i31" label="inner 3 one" theme="ajax">Inner 31</s:div>
|
||||
<s:div id="132" label="inner 3 two" theme="ajax">Inner 32</s:div>
|
||||
<s:div id="i33" label="inner 3 three" theme="ajax">Inner 33</s:div>
|
||||
</s:tabbedPanel>
|
||||
</s:div>
|
||||
</s:tabbedPanel>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -1,25 +1,30 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Ajax examples - tabbled panel</title>
|
||||
|
||||
<jsp:include page="/ajax/commonInclude.jsp"/>
|
||||
<link rel="stylesheet" type="text/css" href="<s:url value="/struts/tabs.css"/>">
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<sx:tabbedpanel id="test2" cssStyle="width: 500px; height: 300px;" doLayout="true">
|
||||
<sx:div label="test1" >
|
||||
I'm a Tab!!!
|
||||
</sx:div >
|
||||
<sx:div id="middle" label="test2" >
|
||||
I'm the other Tab!!!
|
||||
</sx:div >
|
||||
</sx:tabbedpanel>
|
||||
<s:tabbedPanel id="test2" theme="simple" cssStyle="width: 500px; height: 300px;" doLayout="true">
|
||||
<s:div id="left" label="test1" theme="ajax" >
|
||||
I'm a Tab!!!
|
||||
</s:div >
|
||||
<s:div id="middle" label="test2" theme="ajax" >
|
||||
I'm the other Tab!!!
|
||||
</s:div >
|
||||
|
||||
</s:tabbedPanel>
|
||||
|
||||
|
||||
|
||||
<s:include value="../footer.jsp"/>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -1,15 +1,28 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Ajax examples - tabbled panel</title>
|
||||
|
||||
<jsp:include page="/ajax/commonInclude.jsp"/>
|
||||
<link rel="stylesheet" type="text/css" href="<s:url value="/struts/tabs.css"/>">
|
||||
<link rel="stylesheet" type="text/css" href="<s:url value="/struts/niftycorners/niftyCorners.css"/>">
|
||||
<link rel="stylesheet" type="text/css" href="<s:url value="/struts/niftycorners/niftyPrint.css"/>" media="print">
|
||||
<script type="text/javascript" src="<s:url value="/struts/niftycorners/nifty.js"/>"></script>
|
||||
<script type="text/javascript">
|
||||
dojo.event.connect(window, "onload", function() {
|
||||
if (!NiftyCheck())
|
||||
return;
|
||||
Rounded("li.tab_selected", "top", "white", "transparent", "border #ffffffS");
|
||||
Rounded("li.tab_unselected", "top", "white", "transparent", "border #ffffffS");
|
||||
// Rounded("div#tab_header_main li","top","white","transparent","border #ffffffS");
|
||||
// "white" needs to be replaced with the background color
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<s:url var="ajaxTest" value="/AjaxTest.action" />
|
||||
<s:url id="ajaxTest" value="/AjaxTest.action" />
|
||||
|
||||
<body>
|
||||
|
||||
@@ -17,24 +30,24 @@
|
||||
<tr>
|
||||
<td align="top">
|
||||
<!--// START SNIPPET: tabbedpanel-tag-->
|
||||
<sx:tabbedpanel id="test2" cssStyle="width: 500px; height: 300px;" doLayout="true">
|
||||
<sx:div id="left" label="left">
|
||||
<s:tabbedPanel id="test2" theme="simple" cssStyle="width: 500px; height: 300px;" doLayout="true">
|
||||
<s:div theme="ajax" id="left" label="left">
|
||||
This is the left pane<br/>
|
||||
<s:form >
|
||||
<s:textfield name="tt" label="Test Text" /> <br/>
|
||||
<s:textfield name="tt2" label="Test Text2" />
|
||||
</s:form>
|
||||
</sx:div>
|
||||
<sx:div href="%{ajaxTest}" id="ryh1" label="remote one" preload="false"/>
|
||||
<sx:div id="middle" label="middle">
|
||||
</s:div>
|
||||
<s:div theme="ajax" href="%{ajaxTest}" id="ryh1" label="remote one" />
|
||||
<s:div theme="ajax" id="middle" label="middle">
|
||||
middle tab<br/>
|
||||
<s:form >
|
||||
<s:textfield name="tt" label="Test Text44" /> <br/>
|
||||
<s:textfield name="tt2" label="Test Text442" />
|
||||
</s:form>
|
||||
</sx:div>
|
||||
<sx:div href="%{ajaxTest}" id="ryh21" label="remote right" preload="false"/>
|
||||
</sx:tabbedpanel>
|
||||
</s:div>
|
||||
<s:div theme="ajax" href="%{ajaxTest}" id="ryh21" label="remote right" />
|
||||
</s:tabbedPanel>
|
||||
<!--// END SNIPPET: tabbedpanel-tag-->
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user