mirror of
https://github.com/apache/struts.git
synced 2026-08-08 16:16:58 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 591347a498 |
+118
@@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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.0.2</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-all</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Combined Struts 2 Jar</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>dependency-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>unjar-deps</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>unpack</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-api</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-config-browser-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-jasperreports-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-jfreechart-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-jsf-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-pell-multipart-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-plexus-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-sitegraph-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-sitemesh-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-struts1-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-tiles-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
|
||||
</artifactItems>
|
||||
<outputDirectory>${project.build.directory}/classes</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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.0.2</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>
|
||||
@@ -0,0 +1,45 @@
|
||||
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();
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
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";
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
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();
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.apache.struts2.servlet;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Implemented by actions which need direct access to the request parameters.
|
||||
*
|
||||
* @author crazybob@google.com (Bob Lee)
|
||||
*/
|
||||
public interface ParameterAware {
|
||||
|
||||
/**
|
||||
* Sets parameters.
|
||||
*
|
||||
* @param parameters map of parameter name to parameter values
|
||||
*/
|
||||
void setParameters(Map<String, String[]> parameters);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.apache.struts2.servlet;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* Implemented by actions which need direct access to the servlet request.
|
||||
*
|
||||
* @author crazybob@google.com (Bob Lee)
|
||||
*/
|
||||
public interface ServletRequestAware {
|
||||
|
||||
/**
|
||||
* Sets the servlet request.
|
||||
*
|
||||
* @param request servlet request.
|
||||
*/
|
||||
void setServletRequest(HttpServletRequest request);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
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();
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
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();
|
||||
}
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.0.8</version>
|
||||
<version>2.0.2</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-blank</artifactId>
|
||||
@@ -47,7 +47,7 @@
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>maven-jetty-plugin</artifactId>
|
||||
<artifactId>maven-jetty6-plugin</artifactId>
|
||||
<configuration>
|
||||
<scanIntervalSeconds>10</scanIntervalSeconds>
|
||||
</configuration>
|
||||
|
||||
@@ -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/).
|
||||
@@ -6,7 +6,7 @@
|
||||
<struts>
|
||||
|
||||
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
|
||||
<constant name="struts.devMode" value="false" />
|
||||
<constant name="struts.devMode" value="true" />
|
||||
|
||||
<include file="example.xml"/>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.0.8</version>
|
||||
<version>2.0.2</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-mailreader</artifactId>
|
||||
@@ -19,7 +19,7 @@
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
@@ -31,8 +31,14 @@
|
||||
<artifactId>struts-mailreader-dao</artifactId>
|
||||
<version>1.3.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-spring-plugin</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans default-autowire="autodetect">
|
||||
<!-- add your spring beans here -->
|
||||
</beans>
|
||||
@@ -32,6 +32,8 @@ import org.apache.struts.apps.mailreader.dao.User;
|
||||
import org.apache.struts.apps.mailreader.dao.UserDatabase;
|
||||
import org.apache.struts.apps.mailreader.dao.impl.memory.MemorySubscription;
|
||||
import org.apache.struts.apps.mailreader.dao.impl.memory.MemoryUser;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -61,28 +63,6 @@ public class MailreaderSupport extends ActionSupport
|
||||
return Constants.CANCEL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method to copy User properties.
|
||||
**/
|
||||
protected void copyUser(User source, User target) {
|
||||
if ((source==null) || (target==null)) return;
|
||||
target.setFromAddress(source.getFromAddress());
|
||||
target.setFullName(source.getFullName());
|
||||
target.setPassword(source.getPassword());
|
||||
target.setReplyToAddress(source.getReplyToAddress());
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method to copy Subscription properties.
|
||||
**/
|
||||
protected void copySubscription(Subscription source, Subscription target) {
|
||||
if ((source==null) || (target==null)) return;
|
||||
target.setAutoConnect(source.getAutoConnect());
|
||||
target.setPassword(source.getPassword());
|
||||
target.setType(source.getType());
|
||||
target.setUsername(source.getUsername());
|
||||
}
|
||||
|
||||
|
||||
// ---- ApplicationAware ----
|
||||
|
||||
@@ -455,7 +435,7 @@ public class MailreaderSupport extends ActionSupport
|
||||
input.setPassword(_password);
|
||||
User user = createUser(_username, _password);
|
||||
if (null != user) {
|
||||
copyUser(input,user);
|
||||
BeanUtils.copyProperties(input,user);
|
||||
setUser(user);
|
||||
}
|
||||
}
|
||||
@@ -552,7 +532,7 @@ public class MailreaderSupport extends ActionSupport
|
||||
Subscription input = getSubscription();
|
||||
Subscription sub = createSubscription(host);
|
||||
if (null != sub) {
|
||||
copySubscription(input, sub);
|
||||
BeanUtils.copyProperties(input, sub);
|
||||
setSubscription(sub);
|
||||
setHost(sub.getHost());
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<constant name="struts.action.extension" value="do" />
|
||||
<constant name="struts.devMode" value="false" />
|
||||
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
|
||||
<constant name="struts.objectFactory" value="spring" />
|
||||
|
||||
<include file="mailreader-default.xml"/>
|
||||
|
||||
|
||||
@@ -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/).
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
|
||||
<display-name>Struts 2 Mailreader</display-name>
|
||||
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>classpath*:applicationContext*.xml</param-value>
|
||||
</context-param>
|
||||
|
||||
<filter>
|
||||
<filter-name>Struts2</filter-name>
|
||||
<filter-class>
|
||||
@@ -13,16 +18,22 @@
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>Struts2</filter-name>
|
||||
<url-pattern>*.do</url-pattern>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<listener>
|
||||
<listener-class>
|
||||
org.springframework.web.context.ContextLoaderListener
|
||||
</listener-class>
|
||||
</listener>
|
||||
|
||||
<!-- Application Listener for Mailreader database -->
|
||||
<listener>
|
||||
<listener-class>
|
||||
mailreader2.ApplicationListener
|
||||
</listener-class>
|
||||
</listener>
|
||||
|
||||
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.html</welcome-file>
|
||||
</welcome-file-list>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
|
||||
<p>
|
||||
<i>
|
||||
This article is meant to introduce a new user to Apache Struts 2 by
|
||||
This article is meant to introduce a new user to Apache Struts 2 by
|
||||
"walking through" a simple, but functional, application.
|
||||
The article includes code snippets, but for the best result, you might
|
||||
want to install the MailReader application on your own development
|
||||
The article includes code snippets, but for the best result, you might
|
||||
want to install the MailReader application on your own development
|
||||
workstation and follow along.
|
||||
Of course, the full source code to the MailReader is included in the
|
||||
Of course, the full source code to the MailReader is included in the
|
||||
distribution.
|
||||
</i>
|
||||
</p>
|
||||
@@ -28,7 +28,7 @@
|
||||
<p>
|
||||
<i>
|
||||
The tour assumes the reader has a basic understanding of the Java
|
||||
language, JavaBeans, web applications, and JavaServer Pages. For
|
||||
language, JavaBeans, web applications, and JavaServer Pages. For
|
||||
background on these technologies, see the
|
||||
<a href="http://struts.apache.org/primer.html">
|
||||
Key Technologies Primer</a>.
|
||||
@@ -215,7 +215,7 @@
|
||||
<hr/>
|
||||
|
||||
<p>
|
||||
You might note that the web.xml configuration does not specify which file extension
|
||||
You might note taht the web.xml configuration does not specify which file extension
|
||||
to use with actions.
|
||||
The default extension for Struts 2 is ".action",
|
||||
but the extension can be changed in the struts.properties file.
|
||||
@@ -255,10 +255,10 @@
|
||||
<p>
|
||||
The actions are listed in one or more XML configuration files,
|
||||
the default configuration file being named "struts.xml".
|
||||
When the application loads, the struts.xml, and any other files
|
||||
it includes, are parsed, and the framework creates a set of
|
||||
configuration objects.
|
||||
Among other things, the configuration maps a request for a certain
|
||||
When the application loads, the struts.xml, and any other files
|
||||
it includes, are parsed, and the framework creates a set of
|
||||
configuration objects.
|
||||
Among other things, the configuration maps a request for a certain
|
||||
page to a certain action mapping.
|
||||
</p>
|
||||
|
||||
@@ -301,7 +301,7 @@
|
||||
<p>
|
||||
When the client requests "Welcome.do", the request is passed to the "struts2"
|
||||
FilterDispatcher (that we registered in the web.xml file).
|
||||
The FilterDispatcher retrieves the appropriate action mapping from the
|
||||
The FilterDispatcher retrieves the appropriate action mapping from the
|
||||
configuration.
|
||||
If we just wanted to forward to the Welcome page, we could use a simple
|
||||
configuration element.
|
||||
@@ -367,8 +367,8 @@
|
||||
<blockquote>
|
||||
<p>
|
||||
The Struts configuration lets us separate concerns and "say it once".
|
||||
The configuration helps us "normalize" an application,
|
||||
in much the same way we normalize a database schema.
|
||||
The configuration helps us "normalize" an application,
|
||||
in much the same way we normalize a database schema.
|
||||
</p>
|
||||
</blockquote>
|
||||
<hr/>
|
||||
@@ -429,7 +429,7 @@ public class Welcome extends MailreaderSupport {
|
||||
<hr/>
|
||||
|
||||
<p>
|
||||
Several common result names are predefined,
|
||||
Several common result names are predefined,
|
||||
including ERROR, SUCCESS, LOGIN, NONE, and INPUT,
|
||||
so that these tokens can be used consistently across Struts 2 applications.
|
||||
</p>
|
||||
@@ -541,7 +541,7 @@ public class Welcome extends MailreaderSupport {
|
||||
<hr/>
|
||||
|
||||
<p>
|
||||
If you change a message in the resource, and then rebuild and reload the
|
||||
If you change a message in the resource, and then rebuild and reload the
|
||||
application, the change will appear throughout the application.
|
||||
If you provide message resources for additional locales, you can
|
||||
localize your application.
|
||||
@@ -820,7 +820,7 @@ public class Welcome extends MailreaderSupport {
|
||||
</p>
|
||||
|
||||
<hr/>
|
||||
<pre><code><#if (actionErrors?exists && actionErrors?size > 0)>
|
||||
<pre><code><#if (actionErrors?exists && actionErrors?size > 0)>
|
||||
<ul>
|
||||
<#list actionErrors as error>
|
||||
<li><span class="errorMessage">${error}</span></li>
|
||||
@@ -837,7 +837,7 @@ public class Welcome extends MailreaderSupport {
|
||||
</p>
|
||||
|
||||
<hr/>
|
||||
<pre><code><#if (actionErrors?exists && actionErrors?size > 0)>
|
||||
<pre><code><#if (actionErrors?exists && actionErrors?size > 0)>
|
||||
<strong><table></strong>
|
||||
<#list actionErrors as error>
|
||||
<strong><tr><td></strong><span class="errorMessage">${error}</span><strong></td></tr></strong>
|
||||
@@ -944,12 +944,12 @@ public class Welcome extends MailreaderSupport {
|
||||
<hr/>
|
||||
|
||||
<p>
|
||||
You may note that the DTD refers to "XWork".
|
||||
You may note that the DTD refers to "XWork".
|
||||
<a href="http://www.opensymphony.com/xwork/">
|
||||
Open Symphony XWork
|
||||
</a> is a generic command-pattern framework that can be used outside of a
|
||||
web environment. Essentially, Struts 2 is a web-based extension of the
|
||||
XWork framework.
|
||||
</a> is a generic command-pattern framework that can be used outside of a
|
||||
web environment. In practice, Struts 2 is a web-based extension of the
|
||||
XWork framework.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -959,7 +959,7 @@ public class Welcome extends MailreaderSupport {
|
||||
If the username is blank or absent, validation will fail and an error
|
||||
message is generated.
|
||||
The messages would be based on the "error.username.required" or
|
||||
"error.password.required" message templates from the resource bundle.
|
||||
"error.password.required" message templates, from the resource bundle.
|
||||
</p>
|
||||
|
||||
<!--
|
||||
@@ -1014,7 +1014,7 @@ public String <strong>execute()</strong> throws ExpiredPasswordException {
|
||||
|
||||
<p>
|
||||
Let's look at the relevant properties and methods from MailreaderSupport
|
||||
and another base class, <strong>ActionSupport</strong>, namely
|
||||
and another base class, <strong>ActionSupport</strong>, namely
|
||||
"getUsername", "getPassword", "findUser", "setUser", and "hasErrors".
|
||||
</p>
|
||||
|
||||
@@ -1064,7 +1064,7 @@ public void setPassword(String password) {
|
||||
<pre><code>public User <strong>findUser</strong>(String username, String password)
|
||||
throws <strong>ExpiredPasswordException</strong> {
|
||||
User user = <strong>getDatabase().findUser(username)</strong>;
|
||||
if ((user != null) && !user.getPassword().equals(password)) {
|
||||
if ((user != null) && !user.getPassword().equals(password)) {
|
||||
user = null;
|
||||
}
|
||||
if (user == null) {
|
||||
@@ -1101,7 +1101,7 @@ public void setPassword(String password) {
|
||||
When "findUser" returns,
|
||||
the Login Action looks to see if a valid (non-null) User object is returned.
|
||||
A valid User is passed to the <strong>User property</strong>.
|
||||
Although it is still a JavaBean property,
|
||||
Although it is still a JavaBean property,
|
||||
the User property is not implemented in quite the same way as Username and Password.
|
||||
</p>
|
||||
|
||||
@@ -1310,7 +1310,7 @@ public void <strong>setSession(Map value)</strong> {
|
||||
<p>
|
||||
Within the Login action element, the first result element is named "input".
|
||||
If validation or authentification fail,
|
||||
the Action class will return "input" and the framework will transfer control to the
|
||||
the Action class will return "input" and the framework will transfer control to the
|
||||
"Login.jsp" page.
|
||||
</p>
|
||||
|
||||
@@ -1427,7 +1427,7 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
|
||||
public String <strong>intercept</strong>(ActionInvocation actionInvocation) throws Exception {
|
||||
Map session = actionInvocation.getInvocationContext().getSession();
|
||||
User user = (User) session.get(Constants.USER_KEY);
|
||||
boolean isAuthenticated = (null!=user) && (null!=user.getDatabase());
|
||||
boolean isAuthenticated = (null!=user) && (null!=user.getDatabase());
|
||||
if (<strong>isAuthenticated</strong>) {
|
||||
return actionInvocation.invoke();
|
||||
}
|
||||
@@ -1473,7 +1473,7 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
|
||||
<hr/>
|
||||
|
||||
<p>
|
||||
The <strong>user</strong> stacks require that the client be authenticated.
|
||||
The <strong>user</strong> stacks require that the client be authenticated.
|
||||
In other words, that a User object is present in the session.
|
||||
The actions using a <strong>guest</strong> stack can be accessed by any client.
|
||||
The <strong>-submit</strong> versions of each can be used with actions
|
||||
@@ -1483,7 +1483,7 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
|
||||
<h5>Double Submits</h5>
|
||||
|
||||
<p>
|
||||
A common problem with designing web applications is that users are impatient
|
||||
A common problem with designing web applications is that users are impatient
|
||||
and response times can vary.
|
||||
Sometimes, people will press a submit button a second time.
|
||||
When this happens, the browser submits the request again,
|
||||
@@ -1518,11 +1518,11 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
|
||||
|
||||
<p>
|
||||
Because the default interceptor stack will now authenticate the client,
|
||||
we need to specify the standard "defaultStack" for the three
|
||||
we need to specify the standard "defaultStack" for the three
|
||||
"guest actions", Welcome, Login, and Register.
|
||||
Requiring authentification by default is the better practice, since it
|
||||
means that we won't forget to enable it when creating new actions.
|
||||
Meanwhile, those pesky users will ensure that we don't forget to disable
|
||||
Requiring authentification by default is the better practice, since it
|
||||
means that we won't forget to enable it when creating new actions.
|
||||
Meanwhile, those pesky users will ensure that we don't forget to disable
|
||||
authentification for "guest" services.
|
||||
</p>
|
||||
|
||||
@@ -1654,7 +1654,7 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
|
||||
The "test" tag is a convenient way to express presentation
|
||||
logic within your pages.
|
||||
Customized pages help to prevent user error,
|
||||
and dynamic customization reduces the number of server pages your
|
||||
and dynamic customization reduces the number of server pages your
|
||||
application needs to maintain, among other benefits.
|
||||
</font></p>
|
||||
</blockquote>
|
||||
@@ -1892,7 +1892,7 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
|
||||
the value for the field is pushed onto the value stack.
|
||||
As a result, if the client enters text into an Integer field,
|
||||
the framework can still redisplay whatever was entered.
|
||||
An invalid input value is not stored in the field (even if it could be).
|
||||
An invalid input value is not stored in the field (even if it could be).
|
||||
The invalid input is pushed onto the stack for the scope of the request.
|
||||
</p>
|
||||
|
||||
@@ -2076,7 +2076,7 @@ public Subscription findSubscription(String host) {
|
||||
|
||||
<p>
|
||||
By keeping routine safety precautions out of the Action class,
|
||||
the all-important Action becomes smaller and easier to maintain.
|
||||
the all-important Actions becomes smaller and easier to maintain.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
+10
-10
@@ -1,14 +1,14 @@
|
||||
<?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.
|
||||
@@ -25,7 +25,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.0.8</version>
|
||||
<version>2.0.2</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
@@ -37,7 +37,7 @@
|
||||
<module>portlet</module>
|
||||
<module>showcase</module>
|
||||
</modules>
|
||||
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/</developerConnection>
|
||||
@@ -50,7 +50,7 @@
|
||||
<url>scp://people.apache.org/www/struts.apache.org/struts2/apps</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>hostedqa</id>
|
||||
@@ -173,9 +173,9 @@
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
|
||||
<finalName>${pom.artifactId}</finalName>
|
||||
|
||||
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
@@ -193,5 +193,5 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
||||
|
||||
+5
-24
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.0.8</version>
|
||||
<version>2.0.2</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-portlet</artifactId>
|
||||
@@ -25,33 +25,14 @@
|
||||
<version>1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-spring-plugin</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
<artifactId>struts2-portlet-plugin</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>velocity</groupId>
|
||||
<artifactId>velocity</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>velocity-tools</groupId>
|
||||
<artifactId>velocity-tools</artifactId>
|
||||
<version>1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-digester</groupId>
|
||||
<artifactId>commons-digester</artifactId>
|
||||
<version>1.8</version>
|
||||
</dependency>
|
||||
|
||||
-->
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
|
||||
@@ -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/).
|
||||
@@ -0,0 +1,2 @@
|
||||
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jFactory
|
||||
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategoryLog
|
||||
@@ -1,6 +1,3 @@
|
||||
<!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"/>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<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 href="/view/ajaxData.action" id="ryh1" theme="ajax" label="remote one" />
|
||||
<s:div id="middle" label="middle" theme="ajax">
|
||||
middle tab<br/>
|
||||
<s:form >
|
||||
@@ -19,7 +19,7 @@
|
||||
<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:div href="/view/ajaxData.action" id="ryh21" theme="ajax" label="remote right" />
|
||||
</s:tabbedPanel>
|
||||
|
||||
<p/>
|
||||
@@ -28,7 +28,7 @@ A DIV that waits for 5 seconds before loading the contents
|
||||
id="once"
|
||||
theme="ajax"
|
||||
cssStyle="border: 1px solid yellow;"
|
||||
href="<s:url action="ajaxData"/>"
|
||||
href="/view/ajaxData.action"
|
||||
delay="5000"
|
||||
loadingText="loading...">
|
||||
Waiting for data</s:div>
|
||||
@@ -37,10 +37,10 @@ A DIV that is updated every 2 seconds
|
||||
<s:div
|
||||
id="twoseconds"
|
||||
cssStyle="border: 1px solid yellow;"
|
||||
href="<s:url action="ajaxData"/>"
|
||||
href="/view/ajaxData.action"
|
||||
theme="ajax"
|
||||
delay="2000"
|
||||
updateFreq="2000"
|
||||
updateInterval="2000"
|
||||
errorText="There was an error"
|
||||
loadingText="loading...">Initial Content
|
||||
</s:div>
|
||||
|
||||
@@ -1,4 +1 @@
|
||||
Hello World from velocity!
|
||||
<p />
|
||||
#surl ("id=url" "action=index")
|
||||
<a href="${url}">Back to the front page</a>
|
||||
|
||||
+11
-12
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.0.8</version>
|
||||
<version>2.0.2</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-showcase</artifactId>
|
||||
@@ -17,7 +17,7 @@
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/showcase/</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/showcase/</url>
|
||||
</scm>
|
||||
|
||||
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
@@ -31,7 +31,7 @@
|
||||
</profile>
|
||||
</profiles>
|
||||
<dependencies>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-struts1-plugin</artifactId>
|
||||
@@ -55,7 +55,7 @@
|
||||
<artifactId>struts2-sitemesh-plugin</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-tiles-plugin</artifactId>
|
||||
@@ -63,10 +63,9 @@
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.tiles</groupId>
|
||||
<artifactId>tiles-jsp</artifactId>
|
||||
<version>2.0.3</version>
|
||||
<scope>runtime</scope>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-continuations-plugin</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -80,14 +79,14 @@
|
||||
<artifactId>struts2-spring-plugin</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Velocity -->
|
||||
<dependency>
|
||||
<groupId>velocity</groupId>
|
||||
@@ -138,9 +137,9 @@
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
<configuration>
|
||||
<!--
|
||||
QuickStart can be used to extend other QuickStart configurations.
|
||||
This is great for applications that have multiple "editions" and
|
||||
extend upon a base webapp or evven just a base set of classes.
|
||||
-->
|
||||
<!--<extendsConfig>../path/to/quickstart.xml</extendsConfig>-->
|
||||
|
||||
<!--
|
||||
QuickStart supports reading your IDEA module configuration and
|
||||
using the libraries there. This is especially useful for maven
|
||||
users who don't have a single directory in their project that
|
||||
contains all the libraries they need.
|
||||
-->
|
||||
<ideaConfig>../../../xwork/xwork.iml,../../core/struts2-core.iml,struts2-showcase.iml</ideaConfig>
|
||||
|
||||
<!-- The context in which to deploy the web application -->
|
||||
<context>/showcase</context>
|
||||
|
||||
<!-- The port in which to deploy the web application -->
|
||||
<port>8080</port>
|
||||
|
||||
<!--
|
||||
The libs directories can be a jar, a directory of jars, or even
|
||||
a directory of directories (searched recursively)
|
||||
<libs>
|
||||
<dir>../../lib</dir>
|
||||
</libs>
|
||||
-->
|
||||
|
||||
<!--
|
||||
Optional: the location where your source files are. If this is
|
||||
not included, the auto-recompiling feature of QuickStart will
|
||||
not be enabled. You may wish to do this anyway, as this feature
|
||||
has been known to cause strange side effects. If you don't
|
||||
specify your sources, you must specify where your classes are by
|
||||
using the classDirs and libs elements
|
||||
<sources>
|
||||
<dir>src/main/java</dir>
|
||||
</sources>
|
||||
-->
|
||||
|
||||
<!--
|
||||
The classDirs directories can be a jar or a directory of classes.
|
||||
The WEB-INF/classes directory for each webDir (below) will automatically
|
||||
be added if it exists.
|
||||
-->
|
||||
<classDirs>
|
||||
<dir>src/main/resources</dir>
|
||||
<dir>target/classes</dir>
|
||||
<dir>../../core/target/classes</dir>
|
||||
</classDirs>
|
||||
|
||||
<!--
|
||||
You can specify one or more directories where your webapp files
|
||||
are located. This is useful if you have your project split up in
|
||||
unique ways. You can also specify the path that the directory is
|
||||
mapped to, relative to the context.
|
||||
-->
|
||||
<webDirs>
|
||||
<webDir>
|
||||
<path>/</path>
|
||||
<dir>src/main/webapp</dir>
|
||||
</webDir>
|
||||
</webDirs>
|
||||
</configuration>
|
||||
@@ -0,0 +1 @@
|
||||
struts.date.format=yyyy/MM/dd hh:mm:ss
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* $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;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import com.opensymphony.xwork2.Preparable;
|
||||
import com.uwyn.rife.continuations.ContinuableObject;
|
||||
|
||||
// START SNIPPET: example
|
||||
public class Guess extends ActionSupport implements Preparable, ContinuableObject {
|
||||
int guess;
|
||||
|
||||
public void prepare() throws Exception {
|
||||
// We clear the error message state before the action.
|
||||
// That is because with continuations, the original (or cloned) action is being
|
||||
// executed, which will still have the old errors and potentially cause problems,
|
||||
// such as with the workflow interceptor
|
||||
clearErrorsAndMessages();
|
||||
}
|
||||
|
||||
public String execute() throws Exception {
|
||||
int answer = new Random().nextInt(100) + 1;
|
||||
int tries = 5;
|
||||
|
||||
while (answer != guess && tries > 0) {
|
||||
pause(Action.SUCCESS);
|
||||
|
||||
if (guess > answer) {
|
||||
addFieldError("guess", "Too high!");
|
||||
} else if (guess < answer) {
|
||||
addFieldError("guess", "Too low!");
|
||||
}
|
||||
|
||||
tries--;
|
||||
}
|
||||
|
||||
if (answer == guess) {
|
||||
addActionMessage("You got it!");
|
||||
} else {
|
||||
addActionMessage("You ran out of tries, the answer was " + answer);
|
||||
}
|
||||
|
||||
return Action.SUCCESS;
|
||||
}
|
||||
|
||||
public void setGuess(int guess) {
|
||||
this.guess = guess;
|
||||
}
|
||||
}
|
||||
// END SNIPPET: example
|
||||
-60
@@ -23,7 +23,6 @@ package org.apache.struts2.showcase;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
@@ -43,11 +42,6 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
|
||||
private List _favouriteCountriesKeys;
|
||||
private List _notFavouriteCountriesKeys;
|
||||
|
||||
private List _favouriteSportsKeys;
|
||||
private List _nonFavouriteSportsKeys;
|
||||
|
||||
private List _favouriteCities;
|
||||
|
||||
private List _prioritisedFavouriteCartoonCharacters;
|
||||
private List _prioritisedFavouriteCars;
|
||||
private List _prioritisedFavouriteCountries;
|
||||
@@ -194,37 +188,6 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
|
||||
_notFavouriteCountriesKeys = notFavouriteCountries;
|
||||
}
|
||||
|
||||
// Sports
|
||||
public Map getDefaultNonFavoriteSports() {
|
||||
Map m = new LinkedHashMap();
|
||||
m.put("basketball", "Basketball");
|
||||
m.put("football", "Football");
|
||||
m.put("baseball", "Baseball");
|
||||
return m;
|
||||
}
|
||||
|
||||
public Map getDefaultFavoriteSports() {
|
||||
return new LinkedHashMap();
|
||||
}
|
||||
|
||||
public List getFavouriteSports() {
|
||||
return _favouriteSportsKeys;
|
||||
}
|
||||
|
||||
public void setFavouriteSports(List favouriteSportsKeys) {
|
||||
this._favouriteSportsKeys = favouriteSportsKeys;
|
||||
}
|
||||
|
||||
public List getNonFavouriteSports() {
|
||||
return _nonFavouriteSportsKeys;
|
||||
}
|
||||
|
||||
public void setNonFavouriteSports(List notFavouriteSportsKeys) {
|
||||
this._nonFavouriteSportsKeys = notFavouriteSportsKeys;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public List getPrioritisedFavouriteCartoonCharacters() {
|
||||
return _prioritisedFavouriteCartoonCharacters;
|
||||
@@ -250,29 +213,6 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
|
||||
|
||||
|
||||
|
||||
public Map getAvailableCities() {
|
||||
Map map = new LinkedHashMap();
|
||||
map.put("boston", "Boston");
|
||||
map.put("new york", "New York");
|
||||
map.put("london", "London");
|
||||
map.put("rome", "Rome");
|
||||
return map;
|
||||
}
|
||||
|
||||
public List getDefaultFavouriteCities() {
|
||||
List list = new ArrayList();
|
||||
list.add("boston");
|
||||
list.add("rome");
|
||||
return list;
|
||||
}
|
||||
|
||||
public List getFavouriteCities() {
|
||||
return _favouriteCities;
|
||||
}
|
||||
|
||||
public void setFavouriteCities(List favouriteCities) {
|
||||
this._favouriteCities = favouriteCities;
|
||||
}
|
||||
|
||||
// actions
|
||||
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
<field name="description1">
|
||||
<field-validator type="requiredstring">
|
||||
<message>Description1 Is Required !!!</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="description2">
|
||||
<field-validator type="requiredstring">
|
||||
<message>Description2 Is Required !!!</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="description3">
|
||||
<field-validator type="requiredstring">
|
||||
<message>Description3 Is Required !!!</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="description4">
|
||||
<field-validator type="requiredstring">
|
||||
<message>Description4 Is Required !!!</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
|
||||
@@ -1,135 +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;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class MoreSelectsAction extends ActionSupport {
|
||||
|
||||
|
||||
private List _prioritisedFavouriteCartoonCharacters;
|
||||
private List _prioritisedFavouriteCars;
|
||||
private List _prioritisedFavouriteCountries;
|
||||
private List favouriteNumbers;
|
||||
|
||||
|
||||
// Cartoon Characters
|
||||
public Map getDefaultFavouriteCartoonCharacters() {
|
||||
Map m = new LinkedHashMap();
|
||||
m.put("heMan", "He-Man");
|
||||
m.put("popeye", "Popeye");
|
||||
m.put("mockeyMouse", "Mickey Mouse");
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
// Cars
|
||||
public Map getDefaultFavouriteCars() {
|
||||
Map m = new LinkedHashMap();
|
||||
m.put("alfaRomeo", "Alfa Romeo");
|
||||
m.put("Toyota", "Toyota");
|
||||
m.put("Mitsubitshi", "Mitsubitshi");
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Countries
|
||||
public Map getDefaultFavouriteCountries() {
|
||||
Map m = new LinkedHashMap();
|
||||
m.put("england", "England");
|
||||
m.put("america", "America");
|
||||
m.put("brazil", "Brazil");
|
||||
return m;
|
||||
}
|
||||
|
||||
public List getDefaultFavouriteNumbers() {
|
||||
List list = new ArrayList();
|
||||
list.add("Three");
|
||||
list.add("Seven");
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List getPrioritisedFavouriteCartoonCharacters() {
|
||||
return _prioritisedFavouriteCartoonCharacters;
|
||||
}
|
||||
public void setPrioritisedFavouriteCartoonCharacters(List prioritisedFavouriteCartoonCharacters) {
|
||||
_prioritisedFavouriteCartoonCharacters = prioritisedFavouriteCartoonCharacters;
|
||||
}
|
||||
|
||||
public List getPrioritisedFavouriteCars() {
|
||||
return _prioritisedFavouriteCars;
|
||||
}
|
||||
public void setPrioritisedFavouriteCars(List prioritisedFavouriteCars) {
|
||||
_prioritisedFavouriteCars = prioritisedFavouriteCars;
|
||||
}
|
||||
|
||||
|
||||
public List getPrioritisedFavouriteCountries() {
|
||||
return _prioritisedFavouriteCountries;
|
||||
}
|
||||
public void setPrioritisedFavouriteCountries(List prioritisedFavouriteCountries) {
|
||||
_prioritisedFavouriteCountries = prioritisedFavouriteCountries;
|
||||
}
|
||||
|
||||
public List getFavouriteNumbers() {
|
||||
return favouriteNumbers;
|
||||
}
|
||||
|
||||
public void setFavouriteNumbers(List favouriteNumbers) {
|
||||
this.favouriteNumbers = favouriteNumbers;
|
||||
}
|
||||
|
||||
public Map getAvailableCities() {
|
||||
Map map = new LinkedHashMap();
|
||||
map.put("boston", "Boston");
|
||||
map.put("new york", "New York");
|
||||
map.put("london", "London");
|
||||
map.put("rome", "Rome");
|
||||
return map;
|
||||
}
|
||||
|
||||
public List getDefaultFavouriteCities() {
|
||||
List list = new ArrayList();
|
||||
list.add("boston");
|
||||
list.add("rome");
|
||||
return list;
|
||||
}
|
||||
|
||||
// actions
|
||||
|
||||
public String input() throws Exception {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
public String submit() throws Exception {
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
Element_friends = java.lang.String
|
||||
+1
@@ -0,0 +1 @@
|
||||
Element_selectedSkills=java.lang.String
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.dtd">
|
||||
<validators>
|
||||
<!-- Field-Validator Syntax -->
|
||||
<field name="currentEmployee.empId">
|
||||
<field-validator type="required">
|
||||
<message key="employee.id.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="currentEmployee.lastName">
|
||||
<field-validator type="requiredstring">
|
||||
<param name="trim">true</param>
|
||||
<message key="employee.lastName.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="currentEmployee.birthDate">
|
||||
<field-validator type="required">
|
||||
<message key="employee.birthDate.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
employee=Employee
|
||||
employee.firstName=First Name
|
||||
employee.lastName=Last Name
|
||||
employee.description=Description
|
||||
|
||||
employee.id.required=Id is required
|
||||
employee.lastName.required=Last Name is required
|
||||
employee.birthDate.required=Birthdate is required
|
||||
employee.backtolist=Back to Employee List
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
employee=Mitarbeiter
|
||||
employee.firstName=Vorname
|
||||
employee.lastName=Nachname
|
||||
employee.description=Beschreibung
|
||||
|
||||
employee.id.required=ID muß angegeben werden
|
||||
employee.lastName.required=Nachname wird benötigt
|
||||
employee.birthDate.required=Geburtsdatum wird benötigt
|
||||
employee.backtolist=Zurück zur Mitarbeiterliste
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.dtd">
|
||||
<validators>
|
||||
<!-- Field-Validator Syntax -->
|
||||
<field name="currentSkill.name">
|
||||
<field-validator type="requiredstring">
|
||||
<param name="trim">true</param>
|
||||
<message key="skill.name.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
@@ -0,0 +1,6 @@
|
||||
skill=Skill
|
||||
skill.name=Name
|
||||
skill.description=Description
|
||||
|
||||
skill.name.required=Name is required
|
||||
skill.backtolist=Back to Skill List
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
skill=Kenntnis
|
||||
skill.name=Name
|
||||
skill.description=Beschreibung
|
||||
|
||||
skill.name.required=Name muss angegeben werden
|
||||
skill.backtolist=Zurück zur Kenntnis Liste
|
||||
+1
@@ -0,0 +1 @@
|
||||
Element_persons=org.apache.struts2.showcase.conversion.Person
|
||||
+5
-10
@@ -27,20 +27,15 @@ import org.apache.struts2.ServletActionContext;
|
||||
import com.opensymphony.xwork2.Action;
|
||||
|
||||
/**
|
||||
* Demonstrates file resource download.
|
||||
* Set filePath to the local file resource to download,
|
||||
* relative to the application root ("/images/struts.gif").
|
||||
* Action to demonstrate how to use file download.
|
||||
* <p/>
|
||||
* This action is used to download a jpeg file from the image folder.
|
||||
*
|
||||
*/
|
||||
public class FileDownloadAction implements Action {
|
||||
|
||||
private String inputPath;
|
||||
public void setInputPath(String value) {
|
||||
inputPath = value;
|
||||
}
|
||||
|
||||
public InputStream getInputStream() throws Exception {
|
||||
return ServletActionContext.getServletContext().getResourceAsStream(inputPath);
|
||||
public InputStream getImageStream() throws Exception {
|
||||
return ServletActionContext.getServletContext().getResourceAsStream("/images/struts.gif");
|
||||
}
|
||||
|
||||
public String execute() throws Exception {
|
||||
|
||||
-20
@@ -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 org.apache.struts2.showcase.freemarker;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
+3
-3
@@ -57,7 +57,7 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
|
||||
|
||||
public String execute() throws MalformedURLException, IOException {
|
||||
|
||||
if (page != null && page.trim().length() > 0) {
|
||||
if (page != null) {
|
||||
|
||||
InputStream in = ClassLoaderUtil.getResourceAsStream(page.substring(page.indexOf("//")+1), getClass());
|
||||
page = page.replace("//", "/");
|
||||
@@ -72,7 +72,7 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
|
||||
pageLines = read(in, -1);
|
||||
}
|
||||
|
||||
if (className != null && className.trim().length() > 0) {
|
||||
if (className != null) {
|
||||
className = "/"+className.replace('.', '/') + ".java";
|
||||
InputStream in = getClass().getResourceAsStream(className);
|
||||
if (in == null) {
|
||||
@@ -81,7 +81,7 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
|
||||
classLines = read(in, -1);
|
||||
}
|
||||
|
||||
if (config != null && config.trim().length() > 0) {
|
||||
if (config != null) {
|
||||
int pos = config.lastIndexOf(':');
|
||||
configLine = Integer.parseInt(config.substring(pos+1));
|
||||
config = config.substring(0, pos).replace("//", "/");
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
<field name="value">
|
||||
<field-validator type="requiredstring">
|
||||
<param name="trim">true</param>
|
||||
<message>Value must not be empty</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
|
||||
<field name="count">
|
||||
<field-validator type="int">
|
||||
<message>Count must be an integer</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
dateValidatorField=java.util.Date
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//OpenSymphony Group//XWork Validator 1.0//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<!-- START SNIPPET: fieldValidatorsExample -->
|
||||
|
||||
<validators>
|
||||
<field name="requiredValidatorField">
|
||||
<field-validator type="required">
|
||||
<message><![CDATA[ required ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="requiredStringValidatorField">
|
||||
<field-validator type="requiredstring">
|
||||
<param name="trim">true</param>
|
||||
<message key="i18n.nothing.here"><![CDATA[ required and must be string ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="requiredStringValidatorField">
|
||||
<field-validator type="requiredstring">
|
||||
<param name="trim">true</param>
|
||||
<message key="i18n.requiredstring"><![CDATA[ required and must be string ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="integerValidatorField">
|
||||
<field-validator type="int">
|
||||
<param name="min">1</param>
|
||||
<param name="max">10</param>
|
||||
<message><![CDATA[ must be integer min 1 max 10 if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="dateValidatorField">
|
||||
<field-validator type="date">
|
||||
<param name="min">01/01/1990</param>
|
||||
<param name="max">01/01/2000</param>
|
||||
<message><![CDATA[ must be a min 01-01-1990 max 01-01-2000 if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="emailValidatorField">
|
||||
<field-validator type="email">
|
||||
<message><![CDATA[ must be a valid email if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="urlValidatorField">
|
||||
<field-validator type="url">
|
||||
<message><![CDATA[ must be a valid url if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="stringLengthValidatorField">
|
||||
<field-validator type="stringlength">
|
||||
<param name="maxLength">4</param>
|
||||
<param name="minLength">2</param>
|
||||
<param name="trim">true</param>
|
||||
<message><![CDATA[ must be a String of a specific greater than 1 less than 5 if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="regexValidatorField">
|
||||
<field-validator type="regex">
|
||||
<param name="expression">.*\.txt</param>
|
||||
<message><![CDATA[ regexValidatorField must match a regexp (.*\.txt) if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="fieldExpressionValidatorField">
|
||||
<field-validator type="fieldexpression">
|
||||
<param name="expression">(fieldExpressionValidatorField == requiredValidatorField)</param>
|
||||
<message><![CDATA[ must be the same as the Required Validator Field if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
|
||||
<!-- END SNIPPET: fieldValidatorsExample -->
|
||||
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//OpenSymphony Group//XWork Validator 1.0//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<!-- START SNIPPET: fieldValidatorsExample -->
|
||||
|
||||
<validators>
|
||||
<field name="requiredValidatorField">
|
||||
<field-validator type="required">
|
||||
<message><![CDATA[ required ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="requiredStringValidatorField">
|
||||
<field-validator type="requiredstring">
|
||||
<param name="trim">true</param>
|
||||
<message><![CDATA[ required and must be string ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="integerValidatorField">
|
||||
<field-validator type="int">
|
||||
<param name="min">1</param>
|
||||
<param name="max">10</param>
|
||||
<message><![CDATA[ must be integer min 1 max 10 if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="dateValidatorField">
|
||||
<field-validator type="date">
|
||||
<param name="min">01/01/1990</param>
|
||||
<param name="max">01/01/2000</param>
|
||||
<message><![CDATA[ must be a min 01-01-1990 max 01-01-2000 if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="emailValidatorField">
|
||||
<field-validator type="email">
|
||||
<message><![CDATA[ must be a valid email if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="urlValidatorField">
|
||||
<field-validator type="url">
|
||||
<message><![CDATA[ must be a valid url if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="stringLengthValidatorField">
|
||||
<field-validator type="stringlength">
|
||||
<param name="maxLength">4</param>
|
||||
<param name="minLength">2</param>
|
||||
<param name="trim">true</param>
|
||||
<message><![CDATA[ must be a String of a specific greater than 1 less than 5 if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="regexValidatorField">
|
||||
<field-validator type="regex">
|
||||
<param name="expression">.*\.txt</param>
|
||||
<message><![CDATA[ regexValidatorField must match a regexp (.*\.txt) if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="fieldExpressionValidatorField">
|
||||
<field-validator type="fieldexpression">
|
||||
<param name="expression">(fieldExpressionValidatorField == requiredValidatorField)</param>
|
||||
<message><![CDATA[ must be the same as the Required Validator Field if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
|
||||
<!-- END SNIPPET: fieldValidatorsExample -->
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
i18n.requiredstring=Test String for required Strings...
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//OpenSymphony Group//XWork Validator 1.0//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
|
||||
<!-- START SNIPPET: nonFieldValidatorsExample -->
|
||||
|
||||
<validators>
|
||||
<validator type="expression">
|
||||
<param name="expression"><![CDATA[ ( (someText == someTextRetype) && (someTextRetype == someTextRetypeAgain) ) ]]></param>
|
||||
<message><![CDATA[ all three text must be exactly the same ]]></message>
|
||||
</validator>
|
||||
</validators>
|
||||
|
||||
<!-- END SNIPPET: nonFieldValidatorsExample -->
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<!-- START SNIPPET: quizValidators -->
|
||||
<!--
|
||||
Add the following DOCTYPE declaration as first line of your XXX-validation.xml file:
|
||||
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
-->
|
||||
<validators>
|
||||
<field name="name">
|
||||
<field-validator type="requiredstring">
|
||||
<message>You must enter a name</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="age">
|
||||
<field-validator type="int">
|
||||
<param name="min">13</param>
|
||||
<param name="max">19</param>
|
||||
<message>Only people ages 13 to 19 may take this quiz</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
|
||||
<!-- END SNIPPET: quizValidators -->
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//OpenSymphony Group//XWork Validator 1.0//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
<field name="name">
|
||||
<field-validator type="requiredstring">
|
||||
<message>Name Required</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="age">
|
||||
<field-validator type="int">
|
||||
<param name="min">1</param>
|
||||
<param name="max">100</param>
|
||||
<message>Age Required (1-100)</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="birthday">
|
||||
<field-validator type="date">
|
||||
<message>Birthday Required</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//OpenSymphony Group//XWork Validator 1.0//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<!-- START SNIPPET: visitorValidatorsExample -->
|
||||
|
||||
<validators>
|
||||
<field name="user">
|
||||
<field-validator type="visitor">
|
||||
<param name="context">userContext</param>
|
||||
<param name="appendPrefix">true</param>
|
||||
<message>User:</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
|
||||
<!-- END SNIPPET: visitorValidatorExample -->
|
||||
|
||||
@@ -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/).
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
<struts>
|
||||
<package name="continuations" extends="struts-default" namespace="/continuations">
|
||||
<action name="guess" class="org.apache.struts2.showcase.Guess">
|
||||
<result type="freemarker">guess.ftl</result>
|
||||
</action>
|
||||
</package>
|
||||
</struts>
|
||||
@@ -10,24 +10,15 @@
|
||||
<default-action-ref name="download"/>
|
||||
|
||||
<action name="download" class="org.apache.struts2.showcase.filedownload.FileDownloadAction">
|
||||
<param name="inputPath">/images/struts.gif</param>
|
||||
<result name="success" type="stream">
|
||||
<param name="contentType">image/gif</param>
|
||||
<param name="inputName">inputStream</param>
|
||||
<param name="contentDisposition">filename="struts.gif"</param>
|
||||
<param name="bufferSize">4096</param>
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="download2" class="org.apache.struts2.showcase.filedownload.FileDownloadAction">
|
||||
<param name="inputPath">/images/struts-gif.zip</param>
|
||||
<result name="success" type="stream">
|
||||
<param name="contentType">application/zip</param>
|
||||
<param name="inputName">inputStream</param>
|
||||
<param name="contentDisposition">filename="struts-gif.zip"</param>
|
||||
<param name="contentType">image/jpeg</param>
|
||||
<param name="inputName">imageStream</param>
|
||||
<param name="contentDisposition">filename="logo.png"</param>
|
||||
<param name="bufferSize">4096</param>
|
||||
</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
</struts>
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
<result type="velocity">exampleSubmited.vm</result>
|
||||
<result name="input" type="velocity">example.vm</result>
|
||||
</action>
|
||||
|
||||
<action name="lotsOfOptiontransferselect" class="org.apache.struts2.showcase.LotsOfOptiontransferselectAction" method="input">
|
||||
<result>lotsOfOptiontransferselect.jsp</result>
|
||||
</action>
|
||||
@@ -30,15 +29,7 @@
|
||||
<result name="input">lotsOfOptiontransferselect.jsp</result>
|
||||
<result>lotsOfOptiontransferselectSubmit.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="moreSelects" class="org.apache.struts2.showcase.MoreSelectsAction" method="input">
|
||||
<result>moreSelects.jsp</result>
|
||||
</action>
|
||||
<action name="moreSelectsSubmit" class="org.apache.struts2.showcase.MoreSelectsAction" method="submit">
|
||||
<result name="input">moreSelects.jsp</result>
|
||||
<result>moreSelectsSubmit.jsp</result>
|
||||
</action>
|
||||
|
||||
|
||||
<!-- START SNIPPET: treeExampleDynamicXWorkXml -->
|
||||
|
||||
<action name="showDynamicTreeAction" class="org.apache.struts2.showcase.ShowDynamicTreeAction">
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
struts.i18n.reload=true
|
||||
struts.devMode = true
|
||||
struts.configuration.xml.reload=true
|
||||
struts.continuations.package=org.apache.struts2.showcase
|
||||
struts.custom.i18n.resources=globalMessages
|
||||
#struts.action.extension=jspa
|
||||
struts.url.http.port = 8080
|
||||
struts.freemarker.manager.classname=customFreemarkerManager
|
||||
struts.serve.static=true
|
||||
struts.serve.static.browserCache=false
|
||||
struts.codebehind.defaultPackage=person
|
||||
@@ -7,27 +7,16 @@
|
||||
<!-- START SNIPPET: xworkSample -->
|
||||
<struts>
|
||||
|
||||
<!-- Some or all of these can be flipped to true for debugging -->
|
||||
<constant name="struts.i18n.reload" value="false" />
|
||||
<constant name="struts.devMode" value="false" />
|
||||
<constant name="struts.configuration.xml.reload" value="false" />
|
||||
<constant name="struts.custom.i18n.resources" value="globalMessages" />
|
||||
|
||||
<constant name="struts.codebehind.defaultPackage" value="person" />
|
||||
<constant name="struts.freemarker.manager.classname" value="customFreemarkerManager" />
|
||||
<constant name="struts.serve.static" value="true" />
|
||||
<constant name="struts.serve.static.browserCache" value="false" />
|
||||
|
||||
<include file="struts-chat.xml" />
|
||||
|
||||
|
||||
<include file="struts-hangman.xml" />
|
||||
|
||||
|
||||
<include file="struts-continuations.xml"/>
|
||||
|
||||
<include file="struts-tags.xml"/>
|
||||
|
||||
|
||||
<include file="struts-validation.xml" />
|
||||
|
||||
|
||||
<include file="struts-actionchaining.xml" />
|
||||
|
||||
<include file="struts-ajax.xml" />
|
||||
@@ -37,19 +26,19 @@
|
||||
<include file="struts-person.xml" />
|
||||
|
||||
<include file="struts-wait.xml" />
|
||||
|
||||
|
||||
<include file="struts-jsf.xml" />
|
||||
|
||||
<include file="struts-token.xml" />
|
||||
|
||||
|
||||
<include file="struts-model-driven.xml" />
|
||||
|
||||
|
||||
<include file="struts-integration.xml" />
|
||||
|
||||
|
||||
<include file="struts-filedownload.xml" />
|
||||
|
||||
|
||||
<include file="struts-conversion.xml" />
|
||||
|
||||
|
||||
<include file="struts-freemarker.xml" />
|
||||
|
||||
<include file="struts-tiles.xml" />
|
||||
@@ -59,17 +48,17 @@
|
||||
<package name="default" extends="struts-default">
|
||||
<interceptors>
|
||||
<interceptor-stack name="crudStack">
|
||||
<interceptor-ref name="checkbox" />
|
||||
<interceptor-ref name="checkbox" />
|
||||
<interceptor-ref name="params" />
|
||||
<interceptor-ref name="static-params" />
|
||||
<interceptor-ref name="static-params" />
|
||||
<interceptor-ref name="defaultStack" />
|
||||
</interceptor-stack>
|
||||
</interceptors>
|
||||
|
||||
|
||||
<action name="showcase">
|
||||
<result>showcase.jsp</result>
|
||||
</action>
|
||||
|
||||
|
||||
<action name="viewSource" class="org.apache.struts2.showcase.source.ViewSourceAction">
|
||||
<result>viewSource.jsp</result>
|
||||
</action>
|
||||
@@ -110,7 +99,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();
|
||||
@@ -77,25 +77,24 @@
|
||||
<div class="wrapper">
|
||||
<h2 class="accessibility">Navigation</h2>
|
||||
<ul class="clearfix">
|
||||
<li><a href="<s:url value="/showcase.jsp"/>">Home</a></li>
|
||||
<li><a href="<s:url value="/ajax/index.jsp"/>">Ajax</a></li>
|
||||
<li><a href="<s:url value="/chat/index.jsp"/>">Ajax Chat</a></li>
|
||||
<li><a href="<s:url action="actionChain1!input" namespace="/actionchaining" includeParams="none" />">Action Chaining</a></li>
|
||||
<li><a href="<s:url action="index" namespace="/config-browser" includeParams="none" />">Config Browser</a></li>
|
||||
<li><a href="<s:url value="/conversion/index.jsp"/>">Conversion</a></li>
|
||||
<li><a href="<s:url value="/empmanager/index.jsp"/>">CRUD</a></li>
|
||||
<li><a href="<s:url value="/wait/index.jsp"/>">Execute & Wait</a></li>
|
||||
<li><a href="<s:url value="/filedownload/index.jsp"/>">File Download</a></li>
|
||||
<li><a href="<s:url value="/fileupload" />">File Upload</a></li>
|
||||
<li><a href="<s:url value="/freemarker/index.jsp"/>">Freemarker</a>
|
||||
<li><a href="<s:url action="hangmanMenu" namespace="/hangman"/>">Hangman</a></li>
|
||||
<li><a href="<s:url value="/jsf/index.jsp"/>">JavaServer Faces</a></li>
|
||||
<li><a href="<s:url value="/person/index.jsp"/>">Person Manager</a></li>
|
||||
<li><a href="<s:url value="/tags/index.jsp"/>">Tags</a></li>
|
||||
<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 class="last"><a href="<s:url value="/help.jsp"/>">Help</a></li>
|
||||
<li><a href="<s:url value="/showcase.jsp"/>">Home</a></li>
|
||||
<li><a href="<s:url value="/ajax/index.jsp"/>">AJAX</a></li>
|
||||
<li><a href="<s:url action="actionChain1!input" namespace="/actionchaining" includeParams="none" />">Action Chaining</a></li>
|
||||
<li><a href="<s:url action="index" namespace="/config-browser" includeParams="none" />">Config Browser</a></li>
|
||||
<li><a href="<s:url value="/conversion/index.jsp"/>">Conversion</a></li>
|
||||
<li><a href="<s:url value="/empmanager/index.jsp"/>">CRUD</a></li>
|
||||
<li><a href="<s:url value="/wait/index.jsp"/>">Execute & Wait</a></li>
|
||||
<li><a href="<s:url value="/filedownload/index.jsp"/>">File Download</a></li>
|
||||
<li><a href="<s:url value="/fileupload" />">File Upload</a></li>
|
||||
<li><a href="<s:url value="/freemarker/index.jsp"/>">Freemarker</a>
|
||||
<li><a href="<s:url action="hangmanMenu" namespace="/hangman"/>">Hangman</a></li>
|
||||
<li><a href="<s:url value="/jsf/index.jsp"/>">JavaServer Faces</a></li>
|
||||
<li><a href="<s:url value="/person/index.jsp"/>">Person Manager</a></li>
|
||||
<li><a href="<s:url value="/tags/index.jsp"/>">Tags</a></li>
|
||||
<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 class="last"><a href="<s:url value="/help.jsp"/>">Help</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<hr/>
|
||||
@@ -104,11 +103,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,15 +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"/>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ Using a JSON list returned from an action (href="/JSONList.action"), without aut
|
||||
|
||||
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"/>
|
||||
<s:autocompleter 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/>
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Ajax Examples</title>
|
||||
|
||||
<!--// START SNIPPET: common-include-->
|
||||
<jsp:include page="/ajax/commonInclude.jsp"/>
|
||||
<!--// END SNIPPET: common-include-->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
This should have the month label all on one line (problem in IE) appears fine in FF though.
|
||||
<s:paneldatepicker id="foo" language="en-us" displayWeeks="1" staticDisplay="true"/>
|
||||
|
||||
<p>A calendar in your locale, or the closest thing to it we currently provide</p>
|
||||
<s:datepicker id="test" cssStyle="border:1px solid red;padding:1px;"/>
|
||||
|
||||
<p>Same as above, but Friday is the first day of the week. WOOHOO! value="today"</p>
|
||||
<s:datepicker value="today" weekStartsOn="5"/>
|
||||
|
||||
<p>Same as first, but with only 3 weeks displayed</p>
|
||||
<s:datepicker displayWeeks="3"/>
|
||||
|
||||
<p>Same as first, but with adjustWeeks="true"</p>
|
||||
<s:datepicker adjustWeeks="true"/>
|
||||
|
||||
<p>Same as first, with startDate of 10 September 2006</p>
|
||||
<s:datepicker startDate="2006-09-10"/>
|
||||
|
||||
<p>Same as first, with endDate of 10 September 2006</p>
|
||||
<s:datepicker endDate="2006-09-10"/>
|
||||
|
||||
<p>Same as first, with startDate of 1 January 2006 and endDate of 31 December 2006</p>
|
||||
|
||||
<s:datepicker startDate="2006-01-01" endDate="2006-12-31"/>
|
||||
|
||||
<p>Same as first, with startDate of 10 September 2006 and endDate of 24 September 2006 (note how the controls<br/>
|
||||
are disabled). This is considered a static display, because the range of startDate and endDate is less than the displayWeeks.</p>
|
||||
|
||||
<s:datepicker startDate="2006-09-10" endDate="2006-09-24"/>
|
||||
|
||||
<p>Same as first, with startDate of 23 September 2006 and endDate of 10 October 2006 (note where the calendar<br/>
|
||||
display starts since the range overlaps the end of a month and the beginning of a month and how the controls are disabled).<br/>
|
||||
This is considered a static display, because the range of startDate and endDate is less than the displayWeeks.</p>
|
||||
|
||||
<s:datepicker startDate="2006-09-23" endDate="2006-10-10"/>
|
||||
|
||||
<p>Same as first with staticDisplay=true and an initial of value="2005-12-25" (Sunday, December 25, 2005)</p>
|
||||
<s:datepicker staticDisplay="true" value="2005-12-25"/>
|
||||
|
||||
<p>now on to the locale stuff...</p>
|
||||
|
||||
<p>en-us locale</p>
|
||||
<s:datepicker language="en-us" />
|
||||
<p>nl-nl locale</p>
|
||||
<s:datepicker language="nl-nl" />
|
||||
|
||||
<s:include value="../footer.jsp"/>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,39 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Ajax Examples</title>
|
||||
|
||||
<!--// START SNIPPET: common-include-->
|
||||
<jsp:include page="/ajax/commonInclude.jsp"/>
|
||||
<!--// END SNIPPET: common-include-->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>toggleTye="wipe":</p>
|
||||
<s:dropdowndatetimepicker value="2006-10-31" toggleType="wipe" toggleDuration="300" name="test"/>
|
||||
<p>toggleTye="explode":</p>
|
||||
<s:dropdowndatetimepicker value="2006-07-22" toggleType="explode" toggleDuration="500"/>
|
||||
<p>toggleTye="fade":</p>
|
||||
<s:dropdowndatetimepicker value="2006-06-30" toggleType="fade" toggleDuration="500"/>
|
||||
<p>With value="today"</p>
|
||||
<s:dropdowndatetimepicker name="dddp1" value="today" />
|
||||
<p>US format, empty</p>
|
||||
<s:dropdowndatetimepicker name="dddp2" language="en-us" />
|
||||
<p>US format with initial date of 2006-06-26</p>
|
||||
<s:dropdowndatetimepicker name="dddp3" value="2006-06-26" language="en-us" />
|
||||
<p>With initial date of 1969-04-25 and a custom format dd/MM/yyyy</p>
|
||||
<s:dropdowndatetimepicker name="dddp5" value="1969-04-25" displayFormat="dd/MM/yyyy" />
|
||||
<p>In German:</p>
|
||||
<s:dropdowndatetimepicker name="dddp7" value="2006-06-28" language="de" />
|
||||
<p>In Dutch:</p>
|
||||
<s:dropdowndatetimepicker name="dddp8" value="2006-06-28" language="nl" />
|
||||
<p>US format with initial date of 2006-06-26 and long formatting (parse not supported)</p>
|
||||
<s:dropdowndatetimepicker name="dddp12" value="2006-06-26" formatLength="long" language="en-us" />
|
||||
<p>German format with initial date of 2006-06-26 and long formatting (parse not supported)</p>
|
||||
<s:dropdowndatetimepicker name="dddp13" value="2006-06-26" formatLength="long" language="de" />
|
||||
<br/>
|
||||
<s:include value="../footer.jsp"/>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,45 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Ajax Examples</title>
|
||||
|
||||
<!--// START SNIPPET: common-include-->
|
||||
<jsp:include page="/ajax/commonInclude.jsp"/>
|
||||
<!--// END SNIPPET: common-include-->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
toggleTye="wipe":
|
||||
<s:dropdowndatetimepicker type="time" value="10:30" toggleType="wipe" toggleDuration="300"/>
|
||||
<br/>
|
||||
|
||||
toggleTye="explode":
|
||||
<s:dropdowndatetimepicker type="time" value="13:00" toggleType="explode" toggleDuration="500"/>
|
||||
<br/>
|
||||
|
||||
toggleTye="fade":
|
||||
<s:dropdowndatetimepicker type="time" value="13:00" toggleType="fade" toggleDuration="500"/>
|
||||
<br/>
|
||||
|
||||
With value="today":
|
||||
<s:dropdowndatetimepicker type="time" name="dddp1" value="today" />
|
||||
<br/>
|
||||
|
||||
US format, empty
|
||||
<s:dropdowndatetimepicker type="time" name="dddp2" language="en-us" />
|
||||
<br/>
|
||||
|
||||
In German:
|
||||
<s:dropdowndatetimepicker type="time" name="dddp7" language="de" />
|
||||
<br/>
|
||||
|
||||
In Dutch:
|
||||
<s:dropdowndatetimepicker type="time" name="dddp8" language="nl" />
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<s:include value="../footer.jsp"/>
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,19 +5,21 @@
|
||||
|
||||
<h1>AJAX Example</h1>
|
||||
|
||||
<p>
|
||||
Note: The Ajax tags are experimental. These examples have only been tested under FireFox 1.5 and IE 6.
|
||||
</p>
|
||||
Note: these examples have only been tested under FireFox 1.5 and IE 6.
|
||||
|
||||
<ul>
|
||||
<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="autocompleter">Autocompleter combobox tag</a></li>
|
||||
<li><a href="remotelink">Remote link tag</a></li>
|
||||
<li><a href="remotebutton">Remote button 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="datepicker">DatePicker</a></li>
|
||||
<li><a href="dropdowndatepicker">Dropdown DatePicker</a></li>
|
||||
<li><a href="timepicker">TimePicker</a></li>
|
||||
<li><a href="dropdowntimepicker">Dropdown TimePicker</a></li>
|
||||
<li><a href="remoteforms">Remote forms</a></li>
|
||||
<li><a href="widgets">Widgets </a> (experimental - may not work in all browsers
|
||||
see the <a href="http://www.dojotoolkit.org">dojo website</a> for more information</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
<br/><br/>
|
||||
|
||||
<input type=button value="refresh" onclick="controller.refresh()">
|
||||
<input type=button value="stop timer" onclick="controller.stop()">
|
||||
<input type=button value="start timer" onclick="controller.start()">
|
||||
<input type=button value="stop timer" onclick="controller.stop()">
|
||||
|
||||
<s:url id="ajaxTest" value="/AjaxTest.action" />
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Ajax Examples</title>
|
||||
<s:head theme="ajax"/>
|
||||
<jsp:include page="/ajax/commonInclude.jsp"/>
|
||||
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
function doSomething() {
|
||||
@@ -59,7 +59,7 @@ Remote form evaluating suplied JS on completion:<br/>
|
||||
|
||||
<input type='text' name='data' value='Struts User'>
|
||||
|
||||
<s:submit value="GO4" theme="ajax"/>
|
||||
<s:submit value="GO4" theme="ajax" afterLoading="alert('form submitted');"/>
|
||||
|
||||
</s:form>
|
||||
|
||||
@@ -73,7 +73,7 @@ Remote form replacing the forms content after confirming results:<br/>
|
||||
|
||||
<input type='text' name='data' value='Struts User'>
|
||||
|
||||
<s:submit value="GO3" theme="ajax" targets="theForm5" />
|
||||
<s:submit value="GO3" theme="ajax" targets="theForm5" beforeLoading="confirm('sure?');"/>
|
||||
|
||||
</s:form>
|
||||
|
||||
@@ -87,7 +87,7 @@ Remote form replacing the forms content after running a function:<br/>
|
||||
|
||||
<input type='text' name='data' value='Struts User'>
|
||||
|
||||
<s:submit value="GO3" theme="ajax" targets="theForm6" />
|
||||
<s:submit value="GO3" theme="ajax" targets="theForm6" beforeLoading="doSomething();"/>
|
||||
|
||||
</s:form>
|
||||
|
||||
@@ -105,5 +105,7 @@ A form with no remote submit (so should not be ajaxified):<br/>
|
||||
|
||||
</s:form>
|
||||
|
||||
<s:include value="../footer.jsp"/>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
<p>
|
||||
<ol>
|
||||
<li><a href="example2.jsp">A local tabbed panel width fixed size (doLayout="true")</a></li>
|
||||
<li><a href="example3.jsp">A remote (href != "") and local tabbed panel</a></li>
|
||||
<li><a href="example3.jsp">A remote(href != "") and local tabbed panel</a></li>
|
||||
<li><a href="example1.jsp">Various remote and local tabbed panels (with enclosed tabbed pannels) with layout (doLayout="false")</a></li>
|
||||
<li><a href="example4.jsp">A local tabbed panel width fixed size (doLayout="true") with close button on tabs(closeButton="tab"), and tabs on the right (labelposition="right")</a></li>
|
||||
<li><a href="example5.jsp">A local tabbed panel width fixed size (doLayout="true") with close button on the tab pane (closeButton="pane"), and tabs on the bottom (labelposition="bottom")</a></li>
|
||||
<li><a href="example4.jsp">A local tabbed panel width fixed size (doLayout="true") with close button on tabs(closeButton="tab"), and tabs on the right (labelposition="righ")</a></li>
|
||||
<li><a href="example5.jsp">A local tabbed panel width fixed size (doLayout="true") with close button on the tab pane(closeButton="pane"), and tabs on the bottom (labelposition="bottom")</a></li>
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>TimePicker tag</title>
|
||||
<%@ include file="/ajax/commonInclude.jsp" %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h2>Examples</h2>
|
||||
|
||||
Normal English-US timepicker:
|
||||
<s:timepicker language="en-us"/>
|
||||
|
||||
<br>
|
||||
Set time to current time (useDefaultTime="true")
|
||||
<s:timepicker id="tp0" useDefaultTime="true"/>
|
||||
|
||||
<br>
|
||||
Set minutes to current time (useDefaultTime="true" and useDefaultMinutes="true")
|
||||
<s:timepicker id="tp1" useDefaultTime="true" useDefaultMinutes="true"/>
|
||||
|
||||
<br>
|
||||
Set time to 9:43(value="9:43")
|
||||
<s:timepicker id="tp2" value="9:43"/>
|
||||
|
||||
<br>
|
||||
Set time to 1:00PM(value="13:00")
|
||||
<s:timepicker id="tp3" value="13:00"/>
|
||||
|
||||
<br>
|
||||
<s:include value="../footer.jsp"/>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
<!-- START SNIPPET: example -->
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<#list actionMessages as msg>
|
||||
${msg}
|
||||
</#list>
|
||||
|
||||
<@s.form action="guess" method="post">
|
||||
<@s.textfield label="Guess" name="guess"/>
|
||||
<@s.submit value="Guess"/>
|
||||
</@s.form>
|
||||
</body>
|
||||
</html>
|
||||
<!-- END SNIPPET: example -->
|
||||
@@ -23,7 +23,7 @@
|
||||
<s:textfield label="Employee Id" name="currentEmployee.empId"/>
|
||||
<s:textfield label="%{getText('employee.firstName')}" name="currentEmployee.firstName"/>
|
||||
<s:textfield label="%{getText('employee.lastName')}" name="currentEmployee.lastName"/>
|
||||
<s:datetimepicker label="Birthdate" name="currentEmployee.birthDate"/>
|
||||
<s:datepicker label="Birthdate" name="currentEmployee.birthDate"/>
|
||||
<s:textfield label="Salary" name="currentEmployee.salary"/>
|
||||
<s:checkbox fieldValue="true" label="Married" name="currentEmployee.married"/>
|
||||
<s:combobox list="availablePositions" label="Position" name="currentEmployee.position"/>
|
||||
|
||||
@@ -1,22 +1,13 @@
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Showcase - Fileupload</title>
|
||||
<title>Showcase</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>File Download Example</h1>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<s:url id="url" action="download"/><s:a href="%{url}">Download image file.</s:a>
|
||||
The browser should display the Struts logo.
|
||||
</li>
|
||||
<li>
|
||||
<s:url id="url" action="download2"/><s:a href="%{url}">Download ZIP file.</s:a>
|
||||
The browser should prompt for a location to save the ZIP file.
|
||||
</li>
|
||||
</ul>
|
||||
Click this <s:url id="url" action="download"/><s:a href="%{url}">link</s:a> to download Struts logo.
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
</head>
|
||||
<body>
|
||||
<ul>
|
||||
<li>
|
||||
<@s.url id="url" action="hangmanAjax" namespace="/hangman" />
|
||||
<@s.a href="%{#url}">Hangman (Ajax)</@s.a>
|
||||
</li>
|
||||
<li>
|
||||
<@s.url id="url" action="hangmanNonAjax" namespace="/hangman" />
|
||||
<@s.a href="%{#url}">Hangman (Non Ajax)</@s.a>
|
||||
</li>
|
||||
<li>
|
||||
<@s.url id="url" action="hangmanAjax" namespace="/hangman" />
|
||||
(broken) <@s.a href="%{#url}">Hangman (Ajax - Experimental)</@s.a>
|
||||
</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
<%--
|
||||
<%--
|
||||
showcase.jsp
|
||||
|
||||
|
||||
@version $Date$ $Id$
|
||||
--%>
|
||||
|
||||
@@ -12,36 +12,33 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<blockquote>
|
||||
<p>
|
||||
The Struts Showcase demonstrates a variety of use cases and tag usages.
|
||||
Essentially, the application exercises various framework features in isolation.
|
||||
<em>The Showcase is <strong>not</strong> meant as a "best practices" example.</em>
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
For more "by example" solutions,
|
||||
see the <a href="http://struts.apache.org/2.x/docs/cookbook.html">Struts Cookbook</a> pages.
|
||||
</li>
|
||||
<li>
|
||||
For a "best practices" example, see the
|
||||
<a href="http://planetstruts.org/struts2-mailreader/">MailReader application</a> Tour and source code.
|
||||
</li>
|
||||
</ul>
|
||||
</blockquote>
|
||||
<p>
|
||||
The Struts Showcase demonstrates a variety of use cases and tag usages.
|
||||
Essentially, the application exercises various framework features in isolation.
|
||||
<em>The Showcase is <strong>not</strong> meant as a "best practices" example.</em>
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
For more "by example" solutions,
|
||||
see the <a href="http://struts.apache.org/2.x/docs/cookbook.html">Struts Cookbook</a> pages.
|
||||
</li>
|
||||
<li>
|
||||
For a "best practices" example, see the
|
||||
<a href="http://planetstruts.org/struts2-mailreader/">MailReader application</a> Tour and source code.
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
<%-- THIS LIST IS MAINTAINED IN WEB-INF/decorators/main.jsp TO CREATE THE MENU BAR -- EDIT THERE AND COPY HERE --%>
|
||||
<ul>
|
||||
<li><a href="<s:url value="/showcase.jsp"/>">Home</a></li>
|
||||
<li><a href="<s:url value="/ajax/index.jsp" />">Ajax Theme for Struts Tags</a></li>
|
||||
<li><a href="<s:url value="/chat/index.jsp"/>">Ajax Chat</a>
|
||||
<li><a href="<s:url value="/ajax/index.jsp"/>">AJAX</a></li>
|
||||
<li><a href="<s:url action="actionChain1!input" namespace="/actionchaining" includeParams="none" />">Action Chaining</a></li>
|
||||
<li><a href="<s:url action="index" namespace="/config-browser" includeParams="none" />">Config Browser</a></li>
|
||||
<li><a href="<s:url value="/conversion/index.jsp"/>">Conversion</a></li>
|
||||
<li><a href="<s:url value="/empmanager/index.jsp"/>">CRUD</a></li>
|
||||
<li><a href="<s:url value="/wait/index.jsp"/>">Execute & Wait</a></li>
|
||||
<li><a href="<s:url value="/filedownload/index.jsp"/>">File Download</a></li>
|
||||
<li><a href="<s:url value="/fileupload/index.jsp" />">File Upload</a></li>
|
||||
<li><a href="<s:url value="/fileupload" />">File Upload</a></li>
|
||||
<li><a href="<s:url value="/freemarker/index.jsp"/>">Freemarker</a>
|
||||
<li><a href="<s:url action="hangmanMenu" namespace="/hangman"/>">Hangman</a></li>
|
||||
<li><a href="<s:url value="/jsf/index.jsp"/>">JavaServer Faces</a></li>
|
||||
@@ -52,6 +49,34 @@
|
||||
<li><a href="<s:url value="/validation/index.jsp"/>">Validation</a></li>
|
||||
<li class="last"><a href="<s:url value="/help.jsp"/>">Help</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Sandbox</h2>
|
||||
<p>
|
||||
These examples are under development and may not be fully operational.
|
||||
</p>
|
||||
<ul>
|
||||
<li>AJAX / Remote Forms</li>
|
||||
<li><a href="<s:url value="/chat/index.jsp"/>">Chat (AJAX)</a>
|
||||
<li><a href="<s:url action="guess" namespace="/continuations" />">Continuations</a></li>
|
||||
<li>Conversion<ul>
|
||||
<li>Address</li>
|
||||
<li>Java 5 Enum</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Tabs / Non-UI Tags<ul>
|
||||
<li>
|
||||
Action Prefix / Redirect Action
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
<li>Tags / UI Tags<ul>
|
||||
<li>UI Example</li>
|
||||
<li>UI Example (Velocity)</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</p>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>UI Tags Example</title>
|
||||
<s:head />
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<s:datetimepicker label="toggleType='wipe'" value="2006-10-31" toggleType="wipe" toggleDuration="300" name="test"/>
|
||||
<s:datetimepicker label="toggleType='explode'" value="2006-07-22" toggleType="explode" toggleDuration="500"/>
|
||||
<s:datetimepicker label="toggleType='fade'" value="2006-06-30" toggleType="fade" toggleDuration="500"/>
|
||||
<s:datetimepicker label="With value='today'" name="dddp1" value="today" />
|
||||
<s:datetimepicker label="US format, empty" name="dddp2" language="en-us" />
|
||||
<s:datetimepicker label="US format with initial date of 2006-06-26" name="dddp3" value="2006-06-26" language="en-us" />
|
||||
<s:datetimepicker label="With initial date of 1969-04-25 and a custom format dd/MM/yyyy" name="dddp5" value="25/04/1969" displayFormat="dd/MM/yyyy" />
|
||||
<s:datetimepicker label="In German" name="dddp7" value="2006-06-28" language="de" />
|
||||
<s:datetimepicker label="In Dutch" name="dddp8" value="2006-06-28" language="nl" />
|
||||
<s:datetimepicker label="US format with initial date of 2006-06-26 and long formatting (parse not supported)" name="dddp12" value="2006-06-26" formatLength="long" language="en-us" />
|
||||
<s:datetimepicker label="German format with initial date of 2006-06-26 and long formatting (parse not supported)" name="dddp13" value="2006-06-26" formatLength="long" language="de" />
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -19,14 +19,14 @@
|
||||
name="name"
|
||||
tooltip="Enter your Name here" />
|
||||
|
||||
<s:datetimepicker
|
||||
<s:datepicker
|
||||
tooltip="Select Your Birthday"
|
||||
label="Birthday"
|
||||
name="birthday" />
|
||||
|
||||
<s:textarea
|
||||
tooltip="Enter your Biography"
|
||||
label="Biography"
|
||||
label="Biograph"
|
||||
name="bio"
|
||||
cols="20"
|
||||
rows="3"/>
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
#sform ("action=exampleSubmitVelocity" "method=post" "enctype=multipart/form-data")
|
||||
#stextfield ("label=Name" "name=name")
|
||||
#sdatetimepicker ("label=Birthday" "name=birthday")
|
||||
#stextarea ("label=Biography" "name=bio" "cols=20" "rows=3")
|
||||
#sdatepicker ("label=Birthday" "name=birthday")
|
||||
#stextarea ("label=Biograph" "name=bio" "cols=20" "rows=3")
|
||||
#sselect ("label=Favourite Color" "list={'Red', 'Blue', 'Green'}" "name=favouriteColor" "emptyOption=true" "headerKey=None" "headerValue=None")
|
||||
#sselect ("label=Favourite Language" "list=favouriteLanguages" "name=favouriteLanguage" "listKey=key" "listValue=description" "emptyOption=true" "headerKey=None" "headerValue=None")
|
||||
#scheckboxlist ("label=Friends" "list={'Patrick', 'Jason', 'Jay', 'Toby', 'Rene'}" "name=friends")
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user