mirror of
https://github.com/apache/struts.git
synced 2026-08-08 16:16:58 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| df365f17ea |
+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.4</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();
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
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,6 @@
|
||||
Apache Struts
|
||||
|
||||
Copyright 2006 The Apache Software Foundation
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (http://www.apache.org/
|
||||
@@ -1,10 +1,10 @@
|
||||
README.txt - blank
|
||||
|
||||
This is an "empty" application that you can deploy as the basis of your own
|
||||
application.
|
||||
|
||||
For more on getting started with Struts, see
|
||||
|
||||
* http://cwiki.apache.org/WW/home.html
|
||||
|
||||
README.txt - blank
|
||||
|
||||
This is an "empty" application that you can deploy as the basis of your own
|
||||
application.
|
||||
|
||||
For more on getting started with Struts, see
|
||||
|
||||
* http://cwiki.apache.org/WW/home.html
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
+22
-37
@@ -1,32 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.11</version>
|
||||
<version>2.0.4</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-blank</artifactId>
|
||||
@@ -34,9 +13,9 @@
|
||||
<name>Blank Webapp</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_11/apps/blank</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_11/apps/blank</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_11/apps/blank</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/blank/</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/blank/</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/blank/</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
@@ -44,39 +23,45 @@
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>jsp-api</artifactId>
|
||||
<version>2.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>struts2-junit-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>8.1.7.v20120910</version>
|
||||
<artifactId>maven-jetty6-plugin</artifactId>
|
||||
<configuration>
|
||||
<stopKey>CTRL+C</stopKey>
|
||||
<stopPort>8999</stopPort>
|
||||
<scanIntervalSeconds>10</scanIntervalSeconds>
|
||||
<scanTargets>
|
||||
<scanTarget>src/main/webapp/WEB-INF/web.xml</scanTarget>
|
||||
</scanTargets>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-j2ee_1.4_spec</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
set CLASSPATH=..\..\..\lib\xwork-2.0-beta-1.jar
|
||||
javac *.java -d ..\..\..\classes
|
||||
@@ -1,5 +1,5 @@
|
||||
Apache Struts
|
||||
Copyright 2000-2011 The Apache Software Foundation
|
||||
Copyright 2000-2007 The Apache Software Foundation
|
||||
|
||||
This product includes software developed by
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
@@ -1,25 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
|
||||
<package name="example" namespace="/example" extends="default">
|
||||
|
||||
<action name="HelloWorld" class="example.HelloWorld">
|
||||
<result>/example/HelloWorld.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="Login_*" method="{1}" class="example.Login">
|
||||
<result name="input">/example/Login.jsp</result>
|
||||
<result type="redirectAction">Menu</result>
|
||||
</action>
|
||||
|
||||
<action name="*" class="example.ExampleSupport">
|
||||
<result>/example/{1}.jsp</result>
|
||||
</action>
|
||||
|
||||
<!-- Add actions here -->
|
||||
</package>
|
||||
</struts>
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
|
||||
<package name="example" namespace="/example" extends="struts-default">
|
||||
|
||||
<action name="HelloWorld" class="example.HelloWorld">
|
||||
<result>/example/HelloWorld.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="Login_*" method="{1}" class="example.Login">
|
||||
<result name="input">/example/Login.jsp</result>
|
||||
<result type="redirect-action">Menu</result>
|
||||
</action>
|
||||
|
||||
<action name="*" class="example.ExampleSupport">
|
||||
<result>/example/{1}.jsp</result>
|
||||
</action>
|
||||
|
||||
<!-- Add actions here -->
|
||||
</package>
|
||||
</struts>
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//Apache Struts//XWork Validator 1.0.2//EN"
|
||||
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
<field name="username">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="requiredstring"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="password">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="requiredstring"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
<!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="username">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="requiredstring"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="password">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="requiredstring"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
|
||||
@@ -1,33 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.3.dtd">
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
|
||||
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
|
||||
<constant name="struts.devMode" value="true" />
|
||||
|
||||
<package name="default" namespace="/" extends="struts-default">
|
||||
|
||||
<default-action-ref name="index" />
|
||||
|
||||
<global-results>
|
||||
<result name="error">/error.jsp</result>
|
||||
</global-results>
|
||||
|
||||
<global-exception-mappings>
|
||||
<exception-mapping exception="java.lang.Exception" result="error"/>
|
||||
</global-exception-mappings>
|
||||
|
||||
<action name="index">
|
||||
<result type="redirectAction">
|
||||
<param name="actionName">HelloWorld</param>
|
||||
<param name="namespace">/example</param>
|
||||
</result>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
<include file="example.xml"/>
|
||||
|
||||
<!-- Add packages here -->
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<filter>
|
||||
<filter-name>struts2</filter-name>
|
||||
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
|
||||
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
|
||||
<html>
|
||||
<head><title>Simple jsp page</title></head>
|
||||
<body>
|
||||
<h3>Exception:</h3>
|
||||
<s:property value="exception"/>
|
||||
|
||||
<h3>Stack trace:</h3>
|
||||
<pre>
|
||||
<s:property value="exceptionStack"/>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
@@ -26,10 +26,11 @@ import com.opensymphony.xwork2.config.RuntimeConfiguration;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
import com.opensymphony.xwork2.config.entities.ResultConfig;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import org.apache.struts2.StrutsTestCase;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.struts2.StrutsTestCase;
|
||||
|
||||
public class ConfigTest extends StrutsTestCase {
|
||||
|
||||
@@ -43,7 +44,7 @@ public class ConfigTest extends StrutsTestCase {
|
||||
ActionSupport.INPUT.equals(result));
|
||||
}
|
||||
|
||||
protected Map<String, List<String>> assertFieldErrors(ActionSupport action) throws Exception {
|
||||
protected Map assertFieldErrors(ActionSupport action) throws Exception {
|
||||
assertTrue(action.hasFieldErrors());
|
||||
return action.getFieldErrors();
|
||||
}
|
||||
@@ -61,7 +62,7 @@ public class ConfigTest extends StrutsTestCase {
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
XmlConfigurationProvider c = new XmlConfigurationProvider("struts.xml");
|
||||
configurationManager.addContainerProvider(c);
|
||||
configurationManager.addConfigurationProvider(c);
|
||||
configurationManager.reload();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,10 @@
|
||||
|
||||
package example;
|
||||
|
||||
import org.apache.struts2.StrutsTestCase;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class HelloWorldTest extends StrutsTestCase {
|
||||
public class HelloWorldTest extends TestCase {
|
||||
|
||||
public void testHelloWorld() throws Exception {
|
||||
HelloWorld hello_world = new HelloWorld();
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
README.txt - JBoss Blank
|
||||
|
||||
This is an "empty" application that you can deploy as the basis of your own
|
||||
application. This specially dedicated to JBoss server as it includes the Javassist library.
|
||||
|
||||
For more on getting started with Struts, see
|
||||
|
||||
* http://cwiki.apache.org/WW/home.html
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
@@ -1,65 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.11</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-jboss-blank</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>JBoss Blank Webapp</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_11/apps/jboss-blank</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_11/apps/jboss-blank</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_11/apps/jboss-blank</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>jsp-api</artifactId>
|
||||
<version>2.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>struts2-junit-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* $Id: ExampleSupport.java 471756 2006-11-06 15:01:43Z husted $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package example;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
/**
|
||||
* Base Action class for the Tutorial package.
|
||||
*/
|
||||
public class ExampleSupport extends ActionSupport {
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* $Id: HelloWorld.java 471756 2006-11-06 15:01:43Z husted $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package example;
|
||||
|
||||
/**
|
||||
* <code>Set welcome message.</code>
|
||||
*/
|
||||
public class HelloWorld extends ExampleSupport {
|
||||
|
||||
public String execute() throws Exception {
|
||||
setMessage(getText(MESSAGE));
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide default valuie for Message property.
|
||||
*/
|
||||
public static final String MESSAGE = "HelloWorld.message";
|
||||
|
||||
/**
|
||||
* Field for Message property.
|
||||
*/
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* Return Message property.
|
||||
*
|
||||
* @return Message property
|
||||
*/
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Message property.
|
||||
*
|
||||
* @param message Text to display on HelloWorld page.
|
||||
*/
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* $Id: Login.java 471756 2006-11-06 15:01:43Z husted $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package example;
|
||||
|
||||
public class Login extends ExampleSupport {
|
||||
|
||||
public String execute() throws Exception {
|
||||
|
||||
if (isInvalid(getUsername())) return INPUT;
|
||||
|
||||
if (isInvalid(getPassword())) return INPUT;
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
private String username;
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
private String password;
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
Apache Struts
|
||||
Copyright 2000-2011 The Apache Software Foundation
|
||||
|
||||
This product includes software developed by
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
|
||||
<package name="example" namespace="/example" extends="struts-default">
|
||||
|
||||
<action name="HelloWorld" class="example.HelloWorld">
|
||||
<result>/example/HelloWorld.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="Login_*" method="{1}" class="example.Login">
|
||||
<result name="input">/example/Login.jsp</result>
|
||||
<result type="redirectAction">Menu</result>
|
||||
</action>
|
||||
|
||||
<action name="*" class="example.ExampleSupport">
|
||||
<result>/example/{1}.jsp</result>
|
||||
</action>
|
||||
|
||||
<!-- Add actions here -->
|
||||
</package>
|
||||
</struts>
|
||||
@@ -1,16 +0,0 @@
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//Apache Struts//XWork Validator 1.0.2//EN"
|
||||
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
<field name="username">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="requiredstring"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="password">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="requiredstring"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
@@ -1,5 +0,0 @@
|
||||
HelloWorld.message= Struts is up and running ...
|
||||
requiredstring = ${getText(fieldName)} is required.
|
||||
password = Password
|
||||
username = User Name
|
||||
Missing.message = This feature is under construction. Please try again in the next interation.
|
||||
@@ -1,5 +0,0 @@
|
||||
HelloWorld.message= ¡Struts está bien! ...
|
||||
requiredstring = ${getText(fieldName)} se requiere.
|
||||
password = Contraseña
|
||||
username = Nombre de Usuario
|
||||
Missing.message = ¡en obras! ¡seguir intentando!
|
||||
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.3.dtd">
|
||||
|
||||
<struts>
|
||||
|
||||
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
|
||||
<constant name="struts.devMode" value="false" />
|
||||
|
||||
<include file="example.xml"/>
|
||||
|
||||
|
||||
|
||||
<package name="default" namespace="/" extends="struts-default">
|
||||
<default-action-ref name="index" />
|
||||
<action name="index">
|
||||
<result type="redirectAction">
|
||||
<param name="actionName">HelloWorld</param>
|
||||
<param name="namespace">/example</param>
|
||||
</result>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
<!-- Add packages here -->
|
||||
|
||||
</struts>
|
||||
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
|
||||
|
||||
<display-name>Struts Blank</display-name>
|
||||
|
||||
<filter>
|
||||
<filter-name>struts2</filter-name>
|
||||
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>struts2</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.html</welcome-file>
|
||||
</welcome-file-list>
|
||||
|
||||
</web-app>
|
||||
@@ -1,28 +0,0 @@
|
||||
<%@ page contentType="text/html; charset=UTF-8" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title><s:text name="HelloWorld.message"/></title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h2><s:property value="message"/></h2>
|
||||
|
||||
<h3>Languages</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<s:url id="url" action="HelloWorld">
|
||||
<s:param name="request_locale">en</s:param>
|
||||
</s:url>
|
||||
<s:a href="%{url}">English</s:a>
|
||||
</li>
|
||||
<li>
|
||||
<s:url id="url" action="HelloWorld">
|
||||
<s:param name="request_locale">es</s:param>
|
||||
</s:url>
|
||||
<s:a href="%{url}">Espanol</s:a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,15 +0,0 @@
|
||||
<%@ page contentType="text/html; charset=UTF-8" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Sign On</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<s:form action="Login">
|
||||
<s:textfield key="username"/>
|
||||
<s:password key="password" />
|
||||
<s:submit/>
|
||||
</s:form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,3 +0,0 @@
|
||||
<%@ page contentType="text/html; charset=UTF-8" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<s:include value="Missing.jsp"/>
|
||||
@@ -1,11 +0,0 @@
|
||||
<%@ page contentType="text/html; charset=UTF-8" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head><title>Missing Feature</title></head>
|
||||
|
||||
<body>
|
||||
<p>
|
||||
<s:text name="Missing.message"/>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,3 +0,0 @@
|
||||
<%@ page contentType="text/html; charset=UTF-8" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<s:include value="Missing.jsp"/>
|
||||
@@ -1,18 +0,0 @@
|
||||
<%@ page contentType="text/html; charset=UTF-8" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Welcome</title>
|
||||
<link href="<s:url value="/css/examplecss"/>" rel="stylesheet"
|
||||
type="text/css"/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h3>Commands</h3>
|
||||
<ul>
|
||||
<li><a href="<s:url action="Login_input"/>">Sign On</a></li>
|
||||
<li><a href="<s:url action="Register"/>">Register</a></li>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,10 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=example/HelloWorld.action">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>Loading ...</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,96 +0,0 @@
|
||||
/*
|
||||
* $Id: ConfigTest.java 670170 2008-06-21 09:40:34Z hermanns $
|
||||
*
|
||||
* 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 example;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import com.opensymphony.xwork2.config.RuntimeConfiguration;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
import com.opensymphony.xwork2.config.entities.ResultConfig;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import org.apache.struts2.StrutsTestCase;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ConfigTest extends StrutsTestCase {
|
||||
|
||||
protected void assertSuccess(String result) throws Exception {
|
||||
assertTrue("Expected a success result!",
|
||||
ActionSupport.SUCCESS.equals(result));
|
||||
}
|
||||
|
||||
protected void assertInput(String result) throws Exception {
|
||||
assertTrue("Expected an input result!",
|
||||
ActionSupport.INPUT.equals(result));
|
||||
}
|
||||
|
||||
protected Map<String, List<String>> assertFieldErrors(ActionSupport action) throws Exception {
|
||||
assertTrue(action.hasFieldErrors());
|
||||
return action.getFieldErrors();
|
||||
}
|
||||
|
||||
protected void assertFieldError(Map field_errors, String field_name, String error_message) {
|
||||
|
||||
List errors = (List) field_errors.get(field_name);
|
||||
assertNotNull("Expected errors for " + field_name, errors);
|
||||
assertTrue("Expected errors for " + field_name, errors.size()>0);
|
||||
// TODO: Should be a loop
|
||||
assertEquals(error_message,errors.get(0));
|
||||
|
||||
}
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
XmlConfigurationProvider c = new XmlConfigurationProvider("struts.xml");
|
||||
configurationManager.addContainerProvider(c);
|
||||
configurationManager.reload();
|
||||
}
|
||||
|
||||
protected ActionConfig assertClass(String namespace, String action_name, String class_name) {
|
||||
RuntimeConfiguration configuration = configurationManager.getConfiguration().getRuntimeConfiguration();
|
||||
ActionConfig config = configuration.getActionConfig(namespace, action_name);
|
||||
assertNotNull("Mssing action", config);
|
||||
assertTrue("Wrong class name: [" + config.getClassName() + "]",
|
||||
class_name.equals(config.getClassName()));
|
||||
return config;
|
||||
}
|
||||
|
||||
protected ActionConfig assertClass(String action_name, String class_name) {
|
||||
return assertClass("", action_name, class_name);
|
||||
}
|
||||
|
||||
protected void assertResult(ActionConfig config, String result_name, String result_value) {
|
||||
Map results = config.getResults();
|
||||
ResultConfig result = (ResultConfig) results.get(result_name);
|
||||
Map params = result.getParams();
|
||||
String value = (String) params.get("actionName");
|
||||
if (value == null)
|
||||
value = (String) params.get("location");
|
||||
assertTrue("Wrong result value: [" + value + "]",
|
||||
result_value.equals(value));
|
||||
}
|
||||
|
||||
public void testConfig() throws Exception {
|
||||
assertNotNull(configurationManager);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* $Id: HelloWorldTest.java 577750 2007-09-20 13:54:31Z mrdon $
|
||||
*
|
||||
* 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 example;
|
||||
|
||||
import org.apache.struts2.StrutsTestCase;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class HelloWorldTest extends StrutsTestCase {
|
||||
|
||||
public void testHelloWorld() throws Exception {
|
||||
HelloWorld hello_world = new HelloWorld();
|
||||
String result = hello_world.execute();
|
||||
assertTrue("Expected a success result!",
|
||||
ActionSupport.SUCCESS.equals(result));
|
||||
assertTrue("Expected the default message!",
|
||||
hello_world.getText(HelloWorld.MESSAGE).equals(hello_world.getMessage()));
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* $Id: LoginTest.java 471756 2006-11-06 15:01:43Z husted $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package example;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class LoginTest extends ConfigTest {
|
||||
|
||||
public void FIXME_testLoginConfig() throws Exception {
|
||||
ActionConfig config = assertClass("example", "Login_input", "example.Login");
|
||||
assertResult(config, ActionSupport.SUCCESS, "Menu");
|
||||
assertResult(config, ActionSupport.INPUT, "/example/Login.jsp");
|
||||
}
|
||||
|
||||
public void testLoginSubmit() throws Exception {
|
||||
Login login = new Login();
|
||||
login.setUsername("username");
|
||||
login.setPassword("password");
|
||||
String result = login.execute();
|
||||
assertSuccess(result);
|
||||
}
|
||||
|
||||
// Needs access to an envinronment that includes validators
|
||||
public void FIXME_testLoginSubmitInput() throws Exception {
|
||||
Login login = new Login();
|
||||
String result = login.execute();
|
||||
assertInput(result);
|
||||
Map errors = assertFieldErrors(login);
|
||||
assertFieldError(errors,"username","Username is required.");
|
||||
assertFieldError(errors,"password","Password is required.");
|
||||
}
|
||||
|
||||
}
|
||||
+17
-17
@@ -1,18 +1,18 @@
|
||||
README.txt - mailreader
|
||||
|
||||
The MailReader demonstrates a localized application with a master/child
|
||||
CRUD workflow.
|
||||
|
||||
This rendition also demonstrates using wildcards to "normalize" an
|
||||
application.
|
||||
|
||||
See the Sandbox for other MailReader examples using other architectures.
|
||||
|
||||
* http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/
|
||||
|
||||
For more about the MailReader applicaton genneraly, visit Struts University.
|
||||
|
||||
* http://www.StrutsUniversity.org/
|
||||
|
||||
|
||||
README.txt - mailreader
|
||||
|
||||
The MailReader demonstrates a localized application with a master/child
|
||||
CRUD workflow.
|
||||
|
||||
This rendition also demonstrates using wildcards to "normalize" an
|
||||
application.
|
||||
|
||||
See the Sandbox for other MailReader examples using other architectures.
|
||||
|
||||
* http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/
|
||||
|
||||
For more about the MailReader applicaton genneraly, visit Struts University.
|
||||
|
||||
* http://www.StrutsUniversity.org/
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
+18
-58
@@ -1,60 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.11</version>
|
||||
<version>2.0.4</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-mailreader</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>Mail Reader Webapp</name>
|
||||
<name>Starter Webapp</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_11/apps/mailreader</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_11/apps/mailreader</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_11/apps/mailreader</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/mailreader/</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/mailreader/</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/mailreader/</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<groupId>${pom.groupId}</groupId>
|
||||
<artifactId>struts-mailreader-dao</artifactId>
|
||||
<version>1.3.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-spring-plugin</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
@@ -68,35 +52,11 @@
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>8.1.7.v20120910</version>
|
||||
<artifactId>maven-jetty-plugin</artifactId>
|
||||
<version>6.0.1</version>
|
||||
<configuration>
|
||||
<stopKey>CTRL+C</stopKey>
|
||||
<stopPort>8999</stopPort>
|
||||
<systemProperties>
|
||||
<systemProperty>
|
||||
<name>log4j.configuration</name>
|
||||
<value>file:${basedir}/src/main/resources/log4j.properties</value>
|
||||
</systemProperty>
|
||||
<systemProperty>
|
||||
<name>slf4j</name>
|
||||
<value>false</value>
|
||||
</systemProperty>
|
||||
</systemProperties>
|
||||
<scanIntervalSeconds>10</scanIntervalSeconds>
|
||||
<webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
|
||||
<webAppConfig>
|
||||
<contextPath>/struts2-mailreader</contextPath>
|
||||
<descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
|
||||
</webAppConfig>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.17</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
@@ -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>
|
||||
@@ -1,47 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
|
||||
<package name="mailreader-default" namespace="/" extends="struts-default">
|
||||
|
||||
<interceptors>
|
||||
|
||||
<interceptor name="authentication"
|
||||
class="mailreader2.AuthenticationInterceptor"/>
|
||||
|
||||
<interceptor-stack name="user" >
|
||||
<interceptor-ref name="authentication" />
|
||||
<interceptor-ref name="defaultStack"/>
|
||||
</interceptor-stack>
|
||||
|
||||
<interceptor-stack name="user-submit" >
|
||||
<interceptor-ref name="tokenSession" />
|
||||
<interceptor-ref name="user"/>
|
||||
</interceptor-stack>
|
||||
|
||||
<interceptor-stack name="guest" >
|
||||
<interceptor-ref name="defaultStack"/>
|
||||
</interceptor-stack>
|
||||
|
||||
</interceptors>
|
||||
|
||||
<default-interceptor-ref name="user"/>
|
||||
|
||||
<global-results>
|
||||
<result name="error">/pages/Error.jsp</result>
|
||||
<result name="invalid.token">/pages/Error.jsp</result>
|
||||
<result name="login" type="redirectAction">Login_input</result>
|
||||
</global-results>
|
||||
|
||||
<global-exception-mappings>
|
||||
<exception-mapping
|
||||
result="error"
|
||||
exception="java.lang.Throwable"/>
|
||||
</global-exception-mappings>
|
||||
|
||||
</package>
|
||||
|
||||
</struts>
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
|
||||
<package name="mailreader-default" namespace="/" extends="struts-default">
|
||||
|
||||
<interceptors>
|
||||
|
||||
<interceptor name="authentication"
|
||||
class="mailreader2.AuthenticationInterceptor"/>
|
||||
|
||||
<interceptor-stack name="user" >
|
||||
<interceptor-ref name="authentication" />
|
||||
<interceptor-ref name="defaultStack"/>
|
||||
</interceptor-stack>
|
||||
|
||||
<interceptor-stack name="user-submit" >
|
||||
<interceptor-ref name="token-session" />
|
||||
<interceptor-ref name="user"/>
|
||||
</interceptor-stack>
|
||||
|
||||
<interceptor-stack name="guest" >
|
||||
<interceptor-ref name="defaultStack"/>
|
||||
</interceptor-stack>
|
||||
|
||||
</interceptors>
|
||||
|
||||
<default-interceptor-ref name="user"/>
|
||||
|
||||
<global-results>
|
||||
<result name="error">/pages/Error.jsp</result>
|
||||
<result name="invalid.token">/pages/Error.jsp</result>
|
||||
<result name="login" type="redirect-action">Login_input</result>
|
||||
</global-results>
|
||||
|
||||
<global-exception-mappings>
|
||||
<exception-mapping
|
||||
result="error"
|
||||
exception="java.lang.Throwable"/>
|
||||
</global-exception-mappings>
|
||||
|
||||
</package>
|
||||
|
||||
</struts>
|
||||
|
||||
@@ -1,63 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="mailreader-support" namespace="/" extends="mailreader-default">
|
||||
|
||||
<action name="Tour">
|
||||
<result>/tour.html</result>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
|
||||
<action name="Welcome" class="mailreader2.Welcome">
|
||||
<result>/Welcome.jsp</result>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
|
||||
<action name="Logout" class="mailreader2.Logout">
|
||||
<result type="redirectAction">Welcome</result>
|
||||
</action>
|
||||
|
||||
<action name="Login_*" method="{1}" class="mailreader2.Login">
|
||||
<result name="input">/Login.jsp</result>
|
||||
<result name="cancel" type="redirectAction">Welcome</result>
|
||||
<result type="redirectAction">MainMenu</result>
|
||||
<result name="expired" type="chain">ChangePassword</result>
|
||||
<exception-mapping
|
||||
exception="org.apache.struts.apps.mailreader.dao.ExpiredPasswordException"
|
||||
result="expired"/>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
|
||||
<action name="Registration_*" method="{1}" class="mailreader2.Registration">
|
||||
<result name="input">/Registration.jsp</result>
|
||||
<result type="redirectAction">MainMenu</result>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
<package name="subscription" namespace="/" extends="mailreader-support">
|
||||
|
||||
<global-results>
|
||||
<result name="input">/Subscription.jsp</result>
|
||||
<result type="redirectAction">Registration_input</result>
|
||||
</global-results>
|
||||
|
||||
<action name="Subscription_save" method="save" class="mailreader2.Subscription">
|
||||
<interceptor-ref name="user-submit" />
|
||||
</action>
|
||||
|
||||
<action name="Subscription_*" method="{1}" class="mailreader2.Subscription" />
|
||||
|
||||
</package>
|
||||
|
||||
<package name="wildcard" namespace="/" extends="mailreader-support">
|
||||
|
||||
<action name="*" class="mailreader2.MailreaderSupport">
|
||||
<result>/{1}.jsp</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
</struts>
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="mailreader-support" namespace="/" extends="mailreader-default">
|
||||
|
||||
<action name="Tour">
|
||||
<result>/tour.html</result>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
|
||||
<action name="Welcome" class="mailreader2.Welcome">
|
||||
<result>/Welcome.jsp</result>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
|
||||
<action name="Logout" class="mailreader2.Logout">
|
||||
<result type="redirect-action">Welcome</result>
|
||||
</action>
|
||||
|
||||
<action name="Login_*" method="{1}" class="mailreader2.Login">
|
||||
<result name="input">/Login.jsp</result>
|
||||
<result name="cancel" type="redirect-action">Welcome</result>
|
||||
<result type="redirect-action">MainMenu</result>
|
||||
<result name="expired" type="chain">ChangePassword</result>
|
||||
<exception-mapping
|
||||
exception="org.apache.struts.apps.mailreader.dao.ExpiredPasswordException"
|
||||
result="expired"/>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
|
||||
<action name="Registration_*" method="{1}" class="mailreader2.Registration">
|
||||
<result name="input">/Registration.jsp</result>
|
||||
<result type="redirect-action">MainMenu</result>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
<package name="subscription" namespace="/" extends="mailreader-support">
|
||||
|
||||
<global-results>
|
||||
<result name="input">/Subscription.jsp</result>
|
||||
<result type="redirect-action">Registration_input</result>
|
||||
</global-results>
|
||||
|
||||
<action name="Subscription_save" method="save" class="mailreader2.Subscription">
|
||||
<interceptor-ref name="user-submit" />
|
||||
</action>
|
||||
|
||||
<action name="Subscription_*" method="{1}" class="mailreader2.Subscription" />
|
||||
|
||||
</package>
|
||||
|
||||
<package name="wildcard" namespace="/" extends="mailreader-support">
|
||||
|
||||
<action name="*" class="mailreader2.MailreaderSupport">
|
||||
<result>/{1}.jsp</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
</struts>
|
||||
|
||||
@@ -21,20 +21,14 @@
|
||||
|
||||
package mailreader2;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts.apps.mailreader.dao.impl.memory.MemoryUserDatabase;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
|
||||
import org.apache.struts.apps.mailreader.dao.impl.memory.MemoryUserDatabase;
|
||||
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* <p><code>ServletContextListener</code> that initializes and finalizes the
|
||||
@@ -100,7 +94,7 @@ public final class ApplicationListener implements ServletContextListener {
|
||||
/**
|
||||
* <p>Logging output for this plug in instance.</p>
|
||||
*/
|
||||
private Logger log = LoggerFactory.getLogger(this.getClass());
|
||||
private Log log = LogFactory.getLog(this.getClass());
|
||||
|
||||
// ------------------------------------------------------------- Properties
|
||||
|
||||
|
||||
@@ -1,23 +1,3 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package mailreader2;
|
||||
|
||||
import com.opensymphony.xwork2.interceptor.Interceptor;
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
<field name="username">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.username.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="password">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.password.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
@@ -0,0 +1,14 @@
|
||||
<!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="username">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.username.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="password">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.password.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
@@ -21,20 +21,20 @@
|
||||
|
||||
package mailreader2;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.struts2.interceptor.ApplicationAware;
|
||||
import org.apache.struts2.interceptor.SessionAware;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts.apps.mailreader.dao.ExpiredPasswordException;
|
||||
import org.apache.struts.apps.mailreader.dao.Subscription;
|
||||
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.apache.struts2.interceptor.ApplicationAware;
|
||||
import org.apache.struts2.interceptor.SessionAware;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p> Base Action for MailreaderSupport application. </p>
|
||||
@@ -63,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 ----
|
||||
|
||||
@@ -388,7 +366,7 @@ public class MailreaderSupport extends ActionSupport
|
||||
/**
|
||||
* <p><code>Log</code> instance for this application. </p>
|
||||
*/
|
||||
protected Logger log = LoggerFactory.getLogger(Constants.PACKAGE);
|
||||
protected Log log = LogFactory.getLog(Constants.PACKAGE);
|
||||
|
||||
/**
|
||||
* <p> Persist the User object, including subscriptions, to the database.
|
||||
@@ -457,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);
|
||||
}
|
||||
}
|
||||
@@ -554,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());
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ button.doReset=DO_RESULT
|
||||
button.doCancel=org.apache.struts.taglib.html.CANCEL
|
||||
button.reset=Reset
|
||||
button.save=Save
|
||||
button.logon=Log on
|
||||
change.message=Your password has expired. Please ask the system administrator to change it.
|
||||
change.try=Try Again
|
||||
change.title=Password Has Expired
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
|
||||
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
|
||||
<field name="username">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.username.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="user.fullName">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.fullName.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="user.fromAddress">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.fromAddress.required"/>
|
||||
</field-validator>
|
||||
<field-validator type="email">
|
||||
<message key="errors.email"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="user.replyToAddress">
|
||||
<field-validator type="email">
|
||||
<message key="errors.email"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
</validators>
|
||||
<!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="username">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.username.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="user.fullName">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.fullName.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="user.fromAddress">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.fromAddress.required"/>
|
||||
</field-validator>
|
||||
<field-validator type="email">
|
||||
<message key="errors.email"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="user.replyToAddress">
|
||||
<field-validator type="email">
|
||||
<message key="errors.email"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
</validators>
|
||||
|
||||
+23
-23
@@ -1,23 +1,23 @@
|
||||
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
|
||||
<field name="subscription.username">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.username.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="subscription.password">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.password.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="subscription.type">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.type.invalid"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
</validators>
|
||||
<!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="subscription.username">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.username.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="subscription.password">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.password.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="subscription.type">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.type.invalid"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
</validators>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
|
||||
<field name="host">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.host.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
</validators>
|
||||
<!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="host">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.host.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
</validators>
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
|
||||
<constant name="struts.action.extension" value="do" />
|
||||
<constant name="struts.devMode" value="false" />
|
||||
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
|
||||
|
||||
<include file="mailreader-default.xml"/>
|
||||
|
||||
<include file="mailreader-support.xml"/>
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
|
||||
<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"/>
|
||||
|
||||
<include file="mailreader-support.xml"/>
|
||||
|
||||
</struts>
|
||||
@@ -1,5 +1,5 @@
|
||||
Apache Struts
|
||||
Copyright 2000-2011 The Apache Software Foundation
|
||||
Copyright 2000-2007 The Apache Software Foundation
|
||||
|
||||
This product includes software developed by
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
@@ -1,36 +0,0 @@
|
||||
#
|
||||
# Log4J Settings for log4j 1.2.x (via jakarta-commons-logging)
|
||||
#
|
||||
# The five logging levels used by Log are (in order):
|
||||
#
|
||||
# 1. DEBUG (the least serious)
|
||||
# 2. INFO
|
||||
# 3. WARN
|
||||
# 4. ERROR
|
||||
# 5. FATAL (the most serious)
|
||||
|
||||
|
||||
# Set root logger level to WARN and append to stdout
|
||||
log4j.rootLogger=INFO, stdout
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.Target=System.out
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
|
||||
# Pattern to output the caller's file name and line number.
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d %5p (%c:%L) - %m%n
|
||||
|
||||
# Print only messages of level ERROR or above in the package noModule.
|
||||
log4j.logger.noModule=FATAL
|
||||
|
||||
# OpenSymphony Stuff
|
||||
log4j.logger.freemarker=INFO
|
||||
log4j.logger.com.opensymphony=INFO
|
||||
log4j.logger.com.opensymphony.xwork2.ognl=ERROR
|
||||
log4j.logger.org.apache.struts2=WARN
|
||||
log4j.logger.org.apache.struts2.components=WARN
|
||||
log4j.logger.org.apache.struts2.dispatcher=WARN
|
||||
log4j.logger.org.apache.struts2.convention=INFO
|
||||
|
||||
# Spring Stuff
|
||||
log4j.logger.org.springframework=WARN
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
<hr/>
|
||||
|
||||
<p>
|
||||
<a href="<s:url action="Welcome" includeParams="none"/>"><s:text name="index.title"/></a>
|
||||
<a href="<s:url action="Welcome" />"><s:text name="index.title"/></a>
|
||||
</p>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<s:password key="password" showPassword="true"/>
|
||||
|
||||
<s:submit key="button.logon"/>
|
||||
<s:submit key="button.save"/>
|
||||
|
||||
<s:reset key="button.reset"/>
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<s:hidden name="username"/>
|
||||
</s:else>
|
||||
|
||||
<s:password key="password" showPassword="true"/>
|
||||
<s:password key="password"/>
|
||||
<s:password key="password2"/>
|
||||
<s:textfield key="user.fullName"/>
|
||||
<s:textfield key="user.fromAddress"/>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<s:if test="task=='Delete'">
|
||||
<title><s:text name="subscription.title.delete"/></title>
|
||||
</s:if>
|
||||
<link href="<s:url value="/css/mailreader.css" includeParams="none"/>" rel="stylesheet"
|
||||
<link href="<s:url value="/css/mailreader.css"/>" rel="stylesheet"
|
||||
type="text/css"/>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
<?xml version='1.0'?>
|
||||
<database>
|
||||
<user username="user" fromAddress="John.User@somewhere.com" fullName="John Q. User" password="pass">
|
||||
<subscription host="mail.yahoo.com" autoConnect="false" password="foo" type="imap" username="jquser">
|
||||
</subscription>
|
||||
<subscription host="mail.hotmail.com" autoConnect="false" password="bar" type="pop3" username="user1234">
|
||||
</subscription>
|
||||
</user>
|
||||
</database>
|
||||
<?xml version='1.0'?>
|
||||
<database>
|
||||
<user username="user" fromAddress="John.User@somewhere.com"
|
||||
fullName="John Q. User" password="pass">
|
||||
<subscription host="mail.hotmail.com" autoConnect="false"
|
||||
password="bar" type="pop3" username="user1234">
|
||||
</subscription>
|
||||
<subscription host="mail.yahoo.com" autoConnect="false" password="foo"
|
||||
type="imap" username="jquser">
|
||||
</subscription>
|
||||
</user>
|
||||
</database>
|
||||
|
||||
@@ -4,25 +4,36 @@
|
||||
|
||||
<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>
|
||||
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
|
||||
org.apache.struts2.dispatcher.FilterDispatcher
|
||||
</filter-class>
|
||||
</filter>
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -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) {
|
||||
@@ -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();
|
||||
}
|
||||
@@ -1462,7 +1462,7 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
|
||||
<interceptor-ref name="defaultStack"/>
|
||||
</interceptor-stack>
|
||||
<interceptor-stack name="<strong>user-submit</strong>" >
|
||||
<interceptor-ref name="tokenSession" />
|
||||
<interceptor-ref name="token-session" />
|
||||
<interceptor-ref name="user"/>
|
||||
</interceptor-stack>
|
||||
<interceptor-stack name="<strong>guest</strong>" >
|
||||
|
||||
+67
-98
@@ -1,32 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
/*
|
||||
* Copyright 2005-2006 The Apache Software Foundation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<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">
|
||||
|
||||
<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.3.11</version>
|
||||
<version>2.0.4</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
@@ -34,19 +33,24 @@
|
||||
<name>Webapps</name>
|
||||
<modules>
|
||||
<module>blank</module>
|
||||
<module>jboss-blank</module>
|
||||
<module>mailreader</module>
|
||||
<module>portlet</module>
|
||||
<module>showcase</module>
|
||||
<module>rest-showcase</module>
|
||||
</modules>
|
||||
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_11/apps</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_11/apps</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_11/apps</url>
|
||||
<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>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/</url>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
<site>
|
||||
<id>apache-site</id>
|
||||
<url>scp://people.apache.org/www/struts.apache.org/struts2/apps</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>hostedqa</id>
|
||||
@@ -54,7 +58,7 @@
|
||||
<dependency>
|
||||
<groupId>com.hostedqa</groupId>
|
||||
<artifactId>hostedqa-remote-ant</artifactId>
|
||||
<version>1.7</version>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@@ -101,10 +105,14 @@
|
||||
</goals>
|
||||
<configuration>
|
||||
<tasks>
|
||||
<taskdef resource="hostedqatasks" classpathref="maven.plugin.classpath" />
|
||||
<upload file="${project.build.directory}/${project.build.finalName}.war" account="struts" email="${email}" password="${password}" resourceId="${resourceId}" />
|
||||
<taskdef resource="hostedqatasks" classpathref="maven.plugin.classpath"/>
|
||||
<upload file="${project.build.directory}/${project.build.finalName}.war"
|
||||
account="struts" email="${email}"
|
||||
password="${password}" resourceId="${resourceId}"/>
|
||||
|
||||
<playsuite suiteId="${suiteId}" clientConfigs="${clientConfigs}" appConfigs="${appConfigs}" account="struts" email="${email}" password="${password}" />
|
||||
<playsuite suiteId="${suiteId}" clientConfigs="${clientConfigs}" appConfigs="${appConfigs}" account="struts"
|
||||
email="${email}"
|
||||
password="${password}"/>
|
||||
</tasks>
|
||||
</configuration>
|
||||
</execution>
|
||||
@@ -113,56 +121,32 @@
|
||||
<dependency>
|
||||
<groupId>com.hostedqa</groupId>
|
||||
<artifactId>hostedqa-remote-ant</artifactId>
|
||||
<version>1.7</version>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>release</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>release</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<inherited>true</inherited>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>rat-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<addDefaultLicenseMatchers>false</addDefaultLicenseMatchers>
|
||||
<licenseMatchers>
|
||||
<classNames>
|
||||
<className>rat.analysis.license.ApacheSoftwareLicense20</className>
|
||||
</classNames>
|
||||
</licenseMatchers>
|
||||
<includes>
|
||||
<include>pom.xml</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>src/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.cargo</groupId>
|
||||
<artifactId>cargo-maven2-plugin</artifactId>
|
||||
<configuration>
|
||||
<container>
|
||||
<containerId>tomcat5x</containerId>
|
||||
<home>${cargo.tomcat5x.home}</home>
|
||||
<log>${project.build.directory}/tomcat5x.log</log>
|
||||
<output>${project.build.directory}/tomcat5x.out</output>
|
||||
</container>
|
||||
<configuration>
|
||||
<home>${project.build.directory}/tomcat5x</home>
|
||||
</configuration>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- Include source code under WEB-INF/src/java -->
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
@@ -172,11 +156,13 @@
|
||||
<phase>process-sources</phase>
|
||||
<configuration>
|
||||
<tasks>
|
||||
<copy todir="${project.build.directory}/${project.artifactId}/WEB-INF/src/java" failonerror="false">
|
||||
<fileset dir="${basedir}/src/main/java" />
|
||||
<copy todir="${project.build.directory}/${pom.artifactId}/WEB-INF/src/java"
|
||||
failonerror="false">
|
||||
<fileset dir="${basedir}/src/main/java"/>
|
||||
</copy>
|
||||
<copy todir="${project.build.directory}/${project.artifactId}/WEB-INF/src/java" failonerror="false">
|
||||
<fileset dir="${basedir}/src/main/resources" />
|
||||
<copy todir="${project.build.directory}/${pom.artifactId}/WEB-INF/src/java"
|
||||
failonerror="false">
|
||||
<fileset dir="${basedir}/src/main/resources"/>
|
||||
</copy>
|
||||
</tasks>
|
||||
</configuration>
|
||||
@@ -186,27 +172,10 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<configuration>
|
||||
<webResources>
|
||||
<resource>
|
||||
<directory>${basedir}/src/main/resources</directory>
|
||||
<targetPath>META-INF</targetPath>
|
||||
<includes>
|
||||
<include>LICENSE.txt</include>
|
||||
<include>NOTICE.txt</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</webResources>
|
||||
<warSourceExcludes>WEB-INF/classes/LICENSE.txt,WEB-INF/classes/NOTICE.txt</warSourceExcludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
|
||||
|
||||
<finalName>${pom.artifactId}</finalName>
|
||||
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
@@ -214,15 +183,15 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<version>${struts2.springPlatformVersion}</version>
|
||||
<artifactId>spring-mock</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
||||
|
||||
+16
-16
@@ -1,17 +1,17 @@
|
||||
README.txt - portlet
|
||||
|
||||
This is a simple example of using the portlet API with Struts applications.
|
||||
|
||||
For more on getting started with Struts, see
|
||||
|
||||
* http://cwiki.apache.org/WW/home.html
|
||||
|
||||
WARNING - Additional configuration required for deployment
|
||||
|
||||
Due to difference in portlet container implementations, the portlet
|
||||
WAR is not ready-to-run. Extract the portlet WAR, and then copy the
|
||||
contents of apps/portlet/src/main/etc/<your_portal_server>/ into the
|
||||
WAR's WEB-INF directory.
|
||||
|
||||
|
||||
README.txt - portlet
|
||||
|
||||
This is a simple example of using the portlet API with Struts applications.
|
||||
|
||||
For more on getting started with Struts, see
|
||||
|
||||
* http://cwiki.apache.org/WW/home.html
|
||||
|
||||
WARNING - Additional configuration required for deployment
|
||||
|
||||
Due to difference in portlet contrainer implementations, the porlet
|
||||
WAR is not ready-to-run. Extract the porlet WAR, and then copy the
|
||||
contents of apps/portlet/src/main/etc/<your_portal_server>/ into the
|
||||
WAR's WEB-INF directory.
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
+30
-172
@@ -1,32 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.11</version>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.0.4</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-portlet</artifactId>
|
||||
@@ -34,179 +13,58 @@
|
||||
<name>Portlet Webapp</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_11/apps/portlet</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_11/apps/portlet</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_11/apps/portlet</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/portlet/</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/portlet/</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/portlet/</url>
|
||||
</scm>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>pluto</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- configure maven-war-plugin to use updated web.xml -->
|
||||
<plugin>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<configuration>
|
||||
<webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- bind 'pluto:assemble' goal to 'process-resources' lifecycle -->
|
||||
<plugin>
|
||||
<groupId>org.apache.pluto</groupId>
|
||||
<artifactId>maven-pluto-plugin</artifactId>
|
||||
<version>1.1.3</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>assemble</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>maven-jetty-plugin</artifactId>
|
||||
<configuration>
|
||||
<webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
|
||||
<webDefaultXml>src/main/webapp/WEB-INF/jetty-pluto-web-default.xml</webDefaultXml>
|
||||
<systemProperties>
|
||||
<systemProperty>
|
||||
<name>org.apache.pluto.embedded.portletId</name>
|
||||
<value>StrutsPortlet</value>
|
||||
</systemProperty>
|
||||
</systemProperties>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.bekk.boss</groupId>
|
||||
<artifactId>maven-jetty-pluto-embedded</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>javax.portlet</groupId>
|
||||
<artifactId>portlet-api</artifactId>
|
||||
<groupId>portlet-api</groupId>
|
||||
<artifactId>portlet-api</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-spring-plugin</artifactId>
|
||||
</dependency>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-portlet-plugin</artifactId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-dwr-plugin</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<groupId>velocity</groupId>
|
||||
<artifactId>velocity</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<groupId>velocity-tools</groupId>
|
||||
<artifactId>velocity-tools</artifactId>
|
||||
<version>1.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-digester</groupId>
|
||||
<artifactId>commons-digester</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.8</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>jetty</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.sourceforge.jwebunit</groupId>
|
||||
<artifactId>jwebunit-htmlunit-plugin</artifactId>
|
||||
<version>1.4.1</version>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.bekk.boss</groupId>
|
||||
<artifactId>maven-jetty-pluto-embedded</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>jsp-2.1</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>rat-maven-plugin</artifactId>
|
||||
<version>1.0-alpha-2</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>pom.xml</include>
|
||||
<include>src/**</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>src/main/etc/gridsphere/README-gridsphere.txt</exclude>
|
||||
<exclude>src/main/etc/gridsphere/struts-portlet</exclude>
|
||||
<exclude>src/main/etc/jetspeed2/README-jetspeed2.txt</exclude>
|
||||
<exclude>src/main/etc/jetspeed2/struts-portlet.psml</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
</project>
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
<page>
|
||||
<defaults
|
||||
skin="orange"
|
||||
layout-decorator="tigris"
|
||||
portlet-decorator="tigris"
|
||||
/>
|
||||
<title>Struts Portlet Example Application</title>
|
||||
<metadata name="title" xml:lang="en">Struts Portlet Example Application</metadata>
|
||||
|
||||
<fragment id="simplest" type="layout" name="jetspeed-layouts::VelocityTwoColumns">
|
||||
<fragment id="struts-portlet-1" type="portlet" name="struts-portlet::StrutsPortlet">
|
||||
<property layout="TwoColumns" name="row" value="0" />
|
||||
<property layout="TwoColumns" name="column" value="0" />
|
||||
</fragment>
|
||||
</fragment>
|
||||
|
||||
<security-constraints>
|
||||
<security-constraints-ref>public-view</security-constraints-ref>
|
||||
</security-constraints>
|
||||
<page>
|
||||
<defaults
|
||||
skin="orange"
|
||||
layout-decorator="tigris"
|
||||
portlet-decorator="tigris"
|
||||
/>
|
||||
<title>Struts Portlet Example Application</title>
|
||||
<metadata name="title" xml:lang="en">Struts Portlet Example Application</metadata>
|
||||
|
||||
<fragment id="simplest" type="layout" name="jetspeed-layouts::VelocityTwoColumns">
|
||||
<fragment id="struts-portlet-1" type="portlet" name="struts-portlet::StrutsPortlet">
|
||||
<property layout="TwoColumns" name="row" value="0" />
|
||||
<property layout="TwoColumns" name="column" value="0" />
|
||||
</fragment>
|
||||
</fragment>
|
||||
|
||||
<security-constraints>
|
||||
<security-constraints-ref>public-view</security-constraints-ref>
|
||||
</security-constraints>
|
||||
</page>
|
||||
@@ -20,17 +20,18 @@
|
||||
*/
|
||||
package org.apache.struts2.portlet.example;
|
||||
|
||||
import org.apache.struts2.dispatcher.DefaultActionSupport;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class FormExample extends DefaultActionSupport {
|
||||
public class FormExample extends ActionSupport {
|
||||
|
||||
String firstName = null;
|
||||
String lastName = null;
|
||||
|
||||
public String execute() throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
return super.execute();
|
||||
}
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
@@ -43,8 +44,4 @@ public class FormExample extends DefaultActionSupport {
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String displayResult() {
|
||||
return "displayResult";
|
||||
}
|
||||
}
|
||||
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.portlet.example;
|
||||
|
||||
import org.apache.struts2.portlet.example.model.Name;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import com.opensymphony.xwork2.ModelDriven;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class FormExampleModelDriven extends ActionSupport implements ModelDriven<Name> {
|
||||
|
||||
private Name name = new Name();
|
||||
|
||||
public Name getModel() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
-61
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.portlet.example.eventing;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.portlet.interceptor.PortletRequestAware;
|
||||
import org.apache.struts2.portlet.interceptor.PortletResponseAware;
|
||||
|
||||
import javax.portlet.EventRequest;
|
||||
import javax.portlet.EventResponse;
|
||||
import javax.portlet.PortletRequest;
|
||||
import javax.portlet.PortletResponse;
|
||||
|
||||
public class ProcessAction extends ActionSupport implements PortletRequestAware, PortletResponseAware {
|
||||
|
||||
private PortletRequest request;
|
||||
private PortletResponse response;
|
||||
private String name;
|
||||
|
||||
public String execute() throws Exception {
|
||||
|
||||
if (request instanceof EventRequest) {
|
||||
EventRequest req = (EventRequest) request;
|
||||
EventResponse res = (EventResponse) response;
|
||||
res.setRenderParameter("eventName", (String) req.getEvent().getValue());
|
||||
return "forward";
|
||||
} else {
|
||||
name = request.getParameter("eventName");
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
public void setPortletRequest(PortletRequest request) {
|
||||
this.request = request;
|
||||
}
|
||||
|
||||
public void setPortletResponse(PortletResponse response) {
|
||||
this.response = response;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
-52
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.portlet.example.eventing;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.portlet.interceptor.PortletResponseAware;
|
||||
|
||||
import javax.portlet.ActionResponse;
|
||||
import javax.portlet.PortletResponse;
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
public class PublishAction extends ActionSupport implements PortletResponseAware {
|
||||
|
||||
private PortletResponse response;
|
||||
private String name;
|
||||
|
||||
public String execute() throws Exception {
|
||||
|
||||
if (name != null) {
|
||||
((ActionResponse) response).setEvent(new QName("http://org.apache.struts2.portlets/events", "name"), name);
|
||||
|
||||
addActionMessage("Publishing Event with Parameter name : " + name);
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
public void setPortletResponse(PortletResponse response) {
|
||||
this.response = response;
|
||||
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
-81
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.portlet.example.fileupload;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.apache.struts2.dispatcher.DefaultActionSupport;
|
||||
|
||||
/**
|
||||
* File Upload example's action. <code>FileUploadAction</code>
|
||||
*
|
||||
*/
|
||||
public class FileUploadAction extends DefaultActionSupport {
|
||||
|
||||
private static final long serialVersionUID = 5156288255337069381L;
|
||||
|
||||
private String contentType;
|
||||
private File upload;
|
||||
private String fileName;
|
||||
private String caption;
|
||||
|
||||
// since we are using <s:file name="upload" .../> the file name will be
|
||||
// obtained through getter/setter of <file-tag-name>FileName
|
||||
public String getUploadFileName() {
|
||||
return fileName;
|
||||
}
|
||||
public void setUploadFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
|
||||
// since we are using <s:file name="upload" ... /> the content type will be
|
||||
// obtained through getter/setter of <file-tag-name>ContentType
|
||||
public String getUploadContentType() {
|
||||
return contentType;
|
||||
}
|
||||
public void setUploadContentType(String contentType) {
|
||||
this.contentType = contentType;
|
||||
}
|
||||
|
||||
|
||||
// since we are using <s:file name="upload" ... /> the File itself will be
|
||||
// obtained through getter/setter of <file-tag-name>
|
||||
public File getUpload() {
|
||||
return upload;
|
||||
}
|
||||
public void setUpload(File upload) {
|
||||
this.upload = upload;
|
||||
}
|
||||
|
||||
|
||||
public String getCaption() {
|
||||
return caption;
|
||||
}
|
||||
public void setCaption(String caption) {
|
||||
this.caption = caption;
|
||||
}
|
||||
|
||||
public String upload() throws Exception {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package org.apache.struts2.portlet.example.model;
|
||||
|
||||
public class Name {
|
||||
private String firstName;
|
||||
private String lastName;
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -22,7 +22,7 @@ package org.apache.struts2.portlet.example.spring;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Apache Struts
|
||||
Copyright 2000-2011 The Apache Software Foundation
|
||||
Copyright 2000-2007 The Apache Software Foundation
|
||||
|
||||
This product includes software developed by
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
|
||||
<validators>
|
||||
<field name="firstName">
|
||||
<field-validator type="requiredstring">
|
||||
<message>You must enter a first name</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="lastName">
|
||||
<field-validator type="requiredstring">
|
||||
<message>You must enter a last name</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
|
||||
<!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="firstName">
|
||||
<field-validator type="requiredstring">
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.3.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="edit" extends="struts-portlet-default"
|
||||
namespace="/edit">
|
||||
<action name="index"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/edit/index.jsp</result>
|
||||
</action>
|
||||
<action name="test"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/edit/test.jsp</result>
|
||||
</action>
|
||||
<action name="formExampleEdit"
|
||||
class="org.apache.struts2.portlet.example.FormExample" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/edit/formExampleInput.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFormExampleEdit"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="input">
|
||||
/WEB-INF/edit/formExampleInput.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/edit/processFormExampleForward.action?firstName=${firstName}&lastName=${lastName}
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFormExampleForward"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="success">
|
||||
/WEB-INF/edit/formExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
<package name="editTest" extends="edit" namespace="/edit/dummy/test">
|
||||
<action name="testAction"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/edit/namespaceTest.jsp</result>
|
||||
</action>
|
||||
</package>
|
||||
</struts>
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.3.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="eventing" extends="struts-portlet-default" namespace="/eventing">
|
||||
|
||||
<action name="publish" class="org.apache.struts2.portlet.example.eventing.PublishAction">
|
||||
<result name="success">/WEB-INF/eventing/index.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="process" class="org.apache.struts2.portlet.example.eventing.ProcessAction">
|
||||
<result name="success">/WEB-INF/eventing/process.jsp</result>
|
||||
<result name="forward" type="redirectAction">
|
||||
<param name="actionName">process</param>
|
||||
<param name="namespace">/eventing</param>
|
||||
</result>
|
||||
</action>
|
||||
</package>
|
||||
</struts>
|
||||
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.3.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="help" extends="struts-portlet-default"
|
||||
namespace="/help">
|
||||
<action name="index"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/help/index.jsp</result>
|
||||
</action>
|
||||
</package>
|
||||
</struts>
|
||||
@@ -1,130 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.3.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="view" extends="struts-portlet-default"
|
||||
namespace="/view">
|
||||
<action name="index"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/view/index.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="formExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInput.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFormExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInput.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/formExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="formExamplePrg" class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInputPrg.jsp
|
||||
</result>
|
||||
<result name="success" type="redirectAction">
|
||||
<param name="actionName">formExamplePrg</param>
|
||||
<param name="method">displayResult</param>
|
||||
<param name="firstName">${firstName}</param>
|
||||
<param name="lastName">${lastName}</param>
|
||||
</result>
|
||||
<result name="displayResult">
|
||||
/WEB-INF/view/formExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="formExampleModelDriven"
|
||||
class="org.apache.struts2.portlet.example.FormExampleModelDriven">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInputModelDriven.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/formExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="validationExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInputValidation.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processValidationExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="success">
|
||||
/WEB-INF/view/formExample.jsp
|
||||
</result>
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInputValidation.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="fileUpload" class="org.apache.struts2.portlet.example.fileupload.FileUploadAction">
|
||||
<result name="input">
|
||||
/WEB-INF/view/fileUpload.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/fileUploadSuccess.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="tokenExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/view/tokenExampleInput.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processTokenExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="input">
|
||||
/WEB-INF/view/tokenExampleInput.jsp
|
||||
</result>
|
||||
<result name="invalid.token">
|
||||
/WEB-INF/view/tokenExampleInput.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/tokenExample.jsp
|
||||
</result>
|
||||
<interceptor-ref name="portletDefaultStackWithToken" />
|
||||
</action>
|
||||
|
||||
<action name="springExample" class="springAction">
|
||||
<result name="success">
|
||||
/WEB-INF/view/springExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="freeMarkerExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport" method="input">
|
||||
<result type="freemarker" name="input">
|
||||
/WEB-INF/view/freeMarkerExampleInput.ftl
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFreeMarkerExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="success">/view/processFreeMarkerView.action?firstName=${firstName}&lastName=${lastName}</result>
|
||||
</action>
|
||||
|
||||
<action name="processFreeMarkerView" class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result type="freemarker" name="success">/WEB-INF/view/freeMarkerExample.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="velocityHelloWorld" class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result type="velocity" name="success">/WEB-INF/view/helloWorld.vm</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
</struts>
|
||||
@@ -0,0 +1 @@
|
||||
struts.objectFactory = spring
|
||||
@@ -1,11 +1,161 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.3.dtd">
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//OpenSymphony Group//XWork 1.1.1//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-1.1.1.dtd">
|
||||
<xwork>
|
||||
<include file="struts-portlet-default.xml" />
|
||||
|
||||
<struts>
|
||||
<include file="struts-view.xml"/>
|
||||
<include file="struts-edit.xml"/>
|
||||
<include file="struts-help.xml"/>
|
||||
<include file="struts-eventing.xml"/>
|
||||
</struts>
|
||||
<package name="view" extends="struts-portlet-default"
|
||||
namespace="/view">
|
||||
<action name="index"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/view/index.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="formExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInput.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFormExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInput.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/formExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="validationExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInputValidation.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processValidationExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="success">
|
||||
/WEB-INF/view/formExample.jsp
|
||||
</result>
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInputValidation.jsp
|
||||
</result>
|
||||
<interceptor-ref name="validationWorkflowStack" />
|
||||
</action>
|
||||
|
||||
<action name="tokenExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/view/tokenExampleInput.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processTokenExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="input">
|
||||
/WEB-INF/view/tokenExampleInput.jsp
|
||||
</result>
|
||||
<result name="invalid.token">
|
||||
/WEB-INF/view/tokenExampleInput.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/tokenExample.jsp
|
||||
</result>
|
||||
<interceptor-ref name="token" />
|
||||
<interceptor-ref name="defaultStack" />
|
||||
</action>
|
||||
|
||||
<action name="springExample" class="springAction">
|
||||
<result name="success">
|
||||
/WEB-INF/view/springExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="ajaxExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">
|
||||
/WEB-INF/view/ajaxExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="ajaxData"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/view/ajaxData.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="freeMarkerExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport" method="input">
|
||||
<result type="freemarker" name="input">
|
||||
/WEB-INF/view/freeMarkerExampleInput.ftl
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFreeMarkerExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="success">/view/processFreeMarkerView.action?firstName=${firstName}&lastName=${lastName}</result>
|
||||
</action>
|
||||
|
||||
<action name="processFreeMarkerView" class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result type="freemarker" name="success">/WEB-INF/view/freeMarkerExample.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="velocityHelloWorld" class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result type="velocity" name="success">/WEB-INF/view/helloWorld.vm</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
|
||||
<package name="edit" extends="struts-portlet-default"
|
||||
namespace="/edit">
|
||||
<action name="index"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/edit/index.jsp</result>
|
||||
</action>
|
||||
<action name="test"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/edit/test.jsp</result>
|
||||
</action>
|
||||
<action name="formExampleEdit"
|
||||
class="org.apache.struts2.portlet.example.FormExample" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/edit/formExampleInput.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFormExampleEdit"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="input">
|
||||
/WEB-INF/edtt/formExampleInput.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/edit/processFormExampleForward.action?firstName=${firstName}&lastName=${lastName}
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFormExampleForward"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="success">
|
||||
/WEB-INF/edit/formExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
<package name="editTest" extends="edit" namespace="/edit/dummy/test">
|
||||
<action name="testAction"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/edit/namespaceTest.jsp</result>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
<package name="help" extends="struts-portlet-default"
|
||||
namespace="/help">
|
||||
<action name="index"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/help/index.jsp</result>
|
||||
</action>
|
||||
</package>
|
||||
</xwork>
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//Apache Struts//XWork Validator Config 1.0//EN"
|
||||
"http://struts.apache.org/dtds/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"/>
|
||||
<validator name="int" class="com.opensymphony.xwork2.validator.validators.IntRangeFieldValidator"/>
|
||||
<validator name="short" class="com.opensymphony.xwork2.validator.validators.ShortRangeFieldValidator"/>
|
||||
<validator name="double" class="com.opensymphony.xwork2.validator.validators.DoubleRangeFieldValidator"/>
|
||||
<validator name="date" class="com.opensymphony.xwork2.validator.validators.DateRangeFieldValidator"/>
|
||||
<validator name="expression" class="com.opensymphony.xwork2.validator.validators.ExpressionValidator"/>
|
||||
|
||||
+3
-4
@@ -1,8 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE dwr PUBLIC
|
||||
"-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
|
||||
"http://www.getahead.ltd.uk/dwr/dwr10.dtd">
|
||||
|
||||
<!DOCTYPE dwr PUBLIC
|
||||
"-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
|
||||
"http://www.getahead.ltd.uk/dwr/dwr10.dtd">
|
||||
<dwr>
|
||||
<allow>
|
||||
<create creator="new" javascript="validator">
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user