Anonymous avatar Anonymous committed 78fa704

Transferred code from SourceForge repository as of 2003.07.23 23:40

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk/src@3 e221344d-f017-0410-9bd5-d282ab1896d7

Comments (0)

Files changed (183)

+<?xml version="1.0" encoding="UTF-8"?>
+<jalopy>
+    <general>
+        <compliance>
+            <version>14</version>
+        </compliance>
+        <style>
+            <description>OpenSymphony</description>
+            <name>OpenSymphony</name>
+        </style>
+    </general>
+    <inspector>
+        <enable>false</enable>
+        <naming>
+            <classes>
+                <abstract>[A-Z][a-zA-Z0-9]+</abstract>
+                <general>[A-Z][a-zA-Z0-9]+</general>
+            </classes>
+            <fields>
+                <default>[a-z][\w]+</default>
+                <defaultStatic>[a-z][\w]+</defaultStatic>
+                <defaultStaticFinal>[a-zA-Z][\w]+</defaultStaticFinal>
+                <private>[a-z][\w]+</private>
+                <privateStatic>[a-z][\w]+</privateStatic>
+                <privateStaticFinal>[a-zA-Z][\w]+</privateStaticFinal>
+                <protected>[a-z][\w]+</protected>
+                <protectedStatic>[a-z][\w]+</protectedStatic>
+                <protectedStaticFinal>[a-zA-Z][\w]+</protectedStaticFinal>
+                <public>[a-z][\w]+</public>
+                <publicStatic>[a-z][\w]+</publicStatic>
+                <publicStaticFinal>[a-zA-Z][\w]+</publicStaticFinal>
+            </fields>
+            <interfaces>[A-Z][a-zA-Z0-9]+</interfaces>
+            <labels>\w+</labels>
+            <methods>
+                <default>[a-z][\w]+</default>
+                <defaultStatic>[a-z][\w]+</defaultStatic>
+                <defaultStaticFinal>[a-z][\w]+</defaultStaticFinal>
+                <private>[a-z][\w]+</private>
+                <privateStatic>[a-z][\w]+</privateStatic>
+                <privateStaticFinal>[a-z][\w]+</privateStaticFinal>
+                <protected>[a-z][\w]+</protected>
+                <protectedStatic>[a-z][\w]+</protectedStatic>
+                <protectedStaticFinal>[a-z][\w]+</protectedStaticFinal>
+                <public>[a-z][\w]+</public>
+                <publicStatic>[a-z][\w]+</publicStatic>
+                <publicStaticFinal>[a-z][\w]+</publicStaticFinal>
+            </methods>
+            <packages>[a-z]+(?:\.[a-z]+)*</packages>
+            <parameters>
+                <default>[a-z][\w]+</default>
+                <final>[a-z][\w]+</final>
+            </parameters>
+            <variables>[a-z][\w]*</variables>
+        </naming>
+        <tips>
+            <adhereToNamingConvention>false</adhereToNamingConvention>
+            <alwaysOverrideEquals>false</alwaysOverrideEquals>
+            <alwaysOverrideHashCode>false</alwaysOverrideHashCode>
+            <avoidThreadGroups>false</avoidThreadGroups>
+            <declareCollectionComment>false</declareCollectionComment>
+            <dontIgnoreExceptions>false</dontIgnoreExceptions>
+            <dontSubstituteObjectEquals>false</dontSubstituteObjectEquals>
+            <neverDeclareException>false</neverDeclareException>
+            <neverDeclareThrowable>false</neverDeclareThrowable>
+            <neverInvokeWaitOutsideLoop>false</neverInvokeWaitOutsideLoop>
+            <neverReturnZeroArrays>false</neverReturnZeroArrays>
+            <neverUseEmptyFinally>false</neverUseEmptyFinally>
+            <obeyContractEquals>false</obeyContractEquals>
+            <overrideToString>false</overrideToString>
+            <referToObjectsByInterface>false</referToObjectsByInterface>
+            <replaceStructureWithClass>false</replaceStructureWithClass>
+            <stringLiterallI18n>false</stringLiterallI18n>
+            <useInterfaceOnlyForTypes>false</useInterfaceOnlyForTypes>
+            <wrongCollectionComment>false</wrongCollectionComment>
+        </tips>
+    </inspector>
+    <internal>
+        <version>6</version>
+    </internal>
+    <messages>
+        <priority>
+            <general>30000</general>
+            <parser>30000</parser>
+            <parserJavadoc>30000</parserJavadoc>
+            <printer>30000</printer>
+            <printerJavadoc>30000</printerJavadoc>
+            <transform>30000</transform>
+        </priority>
+        <showErrorStackTrace>true</showErrorStackTrace>
+    </messages>
+    <misc>
+        <threadCount>1</threadCount>
+    </misc>
+    <printer>
+        <alignment>
+            <methodCallChain>true</methodCallChain>
+            <parameterMethodDeclaration>false</parameterMethodDeclaration>
+            <ternaryOperator>true</ternaryOperator>
+            <variableAssignment>false</variableAssignment>
+            <variableIdentifier>false</variableIdentifier>
+        </alignment>
+        <backup>
+            <directory>bak</directory>
+            <level>0</level>
+        </backup>
+        <blanklines>
+            <after>
+                <block>1</block>
+                <braceLeft>0</braceLeft>
+                <class>1</class>
+                <declaration>0</declaration>
+                <footer>1</footer>
+                <header>0</header>
+                <interface>1</interface>
+                <lastImport>2</lastImport>
+                <method>1</method>
+                <package>1</package>
+            </after>
+            <before>
+                <block>1</block>
+                <braceRight>0</braceRight>
+                <caseBlock>1</caseBlock>
+                <comment>
+                    <javadoc>1</javadoc>
+                    <multiline>1</multiline>
+                    <singleline>1</singleline>
+                </comment>
+                <controlStatement>1</controlStatement>
+                <declaration>1</declaration>
+                <footer>0</footer>
+                <header>0</header>
+            </before>
+            <keepUpTo>1</keepUpTo>
+        </blanklines>
+        <braces>
+            <empty>
+                <cuddle>false</cuddle>
+                <insertStatement>false</insertStatement>
+            </empty>
+            <insert>
+                <dowhile>true</dowhile>
+                <for>true</for>
+                <ifelse>true</ifelse>
+                <while>true</while>
+            </insert>
+            <remove>
+                <block>true</block>
+                <dowhile>false</dowhile>
+                <for>false</for>
+                <ifelse>false</ifelse>
+                <while>false</while>
+            </remove>
+            <treatDifferent>
+                <methodClass>false</methodClass>
+                <methodClassIfWrapped>false</methodClassIfWrapped>
+            </treatDifferent>
+        </braces>
+        <chunks>
+            <blanklines>true</blanklines>
+            <comments>true</comments>
+        </chunks>
+        <comments>
+            <format>
+                <multiline>false</multiline>
+            </format>
+            <javadoc>
+                <check>
+                    <innerclass>false</innerclass>
+                    <tags>false</tags>
+                    <throwsTags>false</throwsTags>
+                </check>
+                <fieldsShort>true</fieldsShort>
+                <generate>
+                    <class>1</class>
+                    <constructor>0</constructor>
+                    <field>0</field>
+                    <method>0</method>
+                </generate>
+                <parseComments>false</parseComments>
+                <tags>
+                    <in-line />
+                    <standard />
+                </tags>
+                <templates>
+                    <method>
+                        <bottom> */</bottom>
+                        <exception> * @throws $exceptionType$ DOCUMENT ME!</exception>
+                        <param> * @param $paramType$ DOCUMENT ME!</param>
+                        <return> * @return DOCUMENT ME!</return>
+                        <top>/**| * DOCUMENT ME!</top>
+                    </method>
+                </templates>
+            </javadoc>
+            <remove>
+                <javadoc>false</javadoc>
+                <multiline>false</multiline>
+                <singleline>false</singleline>
+            </remove>
+            <separator>
+                <fillCharacter>/</fillCharacter>
+                <insert>true</insert>
+                <insertRecursive>false</insertRecursive>
+                <text>
+                    <class>Inner Classes</class>
+                    <constructor>Constructors</constructor>
+                    <field>Instance fields</field>
+                    <initializer>Instance initializers</initializer>
+                    <interface>Inner Interfaces</interface>
+                    <method>Methods</method>
+                    <static>Static fields/initializers</static>
+                </text>
+            </separator>
+        </comments>
+        <environment />
+        <footer>
+            <keys />
+            <smartMode>0</smartMode>
+            <use>false</use>
+        </footer>
+        <header>
+            <keys>To change template for new class use|OpenSymphon</keys>
+            <smartMode>0</smartMode>
+            <text>/*| * Copyright (c) 2002-2003 by OpenSymphony| * All rights reserved.| */</text>
+            <use>true</use>
+        </header>
+        <history>
+            <policy>disabled</policy>
+        </history>
+        <imports>
+            <grouping>
+                <defaultDepth>3</defaultDepth>
+                <packages>*:0|gnu:2|java:2|javax:2</packages>
+            </grouping>
+            <policy>disabled</policy>
+            <sort>true</sort>
+        </imports>
+        <indentation>
+            <caseFromSwitch>false</caseFromSwitch>
+            <continuation>
+                <block>true</block>
+                <operator>false</operator>
+            </continuation>
+            <firstColumnComments>true</firstColumnComments>
+            <label>false</label>
+            <policy>
+                <deep>false</deep>
+            </policy>
+            <sizes>
+                <braceCuddled>1</braceCuddled>
+                <braceLeft>1</braceLeft>
+                <braceRight>0</braceRight>
+                <braceRightAfter>1</braceRightAfter>
+                <continuation>4</continuation>
+                <deep>55</deep>
+                <extends>-1</extends>
+                <general>4</general>
+                <implements>-1</implements>
+                <leading>0</leading>
+                <tabs>8</tabs>
+                <throws>-1</throws>
+                <trailingComment>1</trailingComment>
+            </sizes>
+            <tabs>
+                <enable>false</enable>
+                <onlyLeading>false</onlyLeading>
+            </tabs>
+        </indentation>
+        <misc>
+            <arrayBracketsAfterIdent>false</arrayBracketsAfterIdent>
+            <forceFormatting>false</forceFormatting>
+            <insertExpressionParentheses>true</insertExpressionParentheses>
+            <insertLoggingConditional>true</insertLoggingConditional>
+            <insertTrailingNewline>true</insertTrailingNewline>
+            <insertUID>false</insertUID>
+        </misc>
+        <sorting>
+            <declaration>
+                <class>true</class>
+                <constructor>true</constructor>
+                <enable>true</enable>
+                <interface>true</interface>
+                <method>true</method>
+                <order>static|field|initializer|constructor|method|interface|class</order>
+                <variable>true</variable>
+            </declaration>
+            <modifier>
+                <enable>false</enable>
+                <order>public|protected|private|abstract|static|final|synchronized|transient|volatile|native|strictfp</order>
+            </modifier>
+        </sorting>
+        <whitespace>
+            <after>
+                <comma>true</comma>
+                <semicolon>true</semicolon>
+                <typeCast>true</typeCast>
+            </after>
+            <before>
+                <braces>true</braces>
+                <brackets>false</brackets>
+                <bracketsTypes>false</bracketsTypes>
+                <caseColon>false</caseColon>
+                <operator>
+                    <not>false</not>
+                </operator>
+                <parentheses>
+                    <methodCall>false</methodCall>
+                    <methodDeclaration>false</methodDeclaration>
+                    <statement>true</statement>
+                </parentheses>
+            </before>
+            <padding>
+                <braces>false</braces>
+                <brackets>false</brackets>
+                <operator>
+                    <assignment>true</assignment>
+                    <bitwise>true</bitwise>
+                    <logical>true</logical>
+                    <mathematical>true</mathematical>
+                    <relational>true</relational>
+                    <shift>true</shift>
+                </operator>
+                <parenthesis>false</parenthesis>
+                <typeCast>false</typeCast>
+            </padding>
+        </whitespace>
+        <wrapping>
+            <always>
+                <after>
+                    <arrayElement>0</arrayElement>
+                    <braceRight>false</braceRight>
+                    <extendsTypes>false</extendsTypes>
+                    <implementsTypes>false</implementsTypes>
+                    <label>true</label>
+                    <methodCallChained>false</methodCallChained>
+                    <ternaryOperator>
+                        <first>false</first>
+                        <second>false</second>
+                    </ternaryOperator>
+                    <throwsTypes>false</throwsTypes>
+                </after>
+                <before>
+                    <braceLeft>false</braceLeft>
+                    <extends>false</extends>
+                    <implements>false</implements>
+                    <throws>false</throws>
+                </before>
+                <parameter>
+                    <methodCall>false</methodCall>
+                    <methodCallNested>false</methodCallNested>
+                    <methodDeclaration>false</methodDeclaration>
+                </parameter>
+            </always>
+            <general>
+                <beforeOperator>false</beforeOperator>
+                <enable>false</enable>
+                <lineLength>80</lineLength>
+            </general>
+            <ondemand>
+                <after>
+                    <assignment>false</assignment>
+                    <leftParenthesis>false</leftParenthesis>
+                    <parameter>false</parameter>
+                    <types>
+                        <extends>false</extends>
+                        <implements>false</implements>
+                        <throws>false</throws>
+                    </types>
+                </after>
+                <before>
+                    <rightParenthesis>false</rightParenthesis>
+                </before>
+                <groupingParentheses>false</groupingParentheses>
+            </ondemand>
+        </wrapping>
+    </printer>
+</jalopy>
+

etc/xwork-1.0.dtd

+<?xml version="1.0" encoding="UTF-8"?>
+<!ELEMENT xwork (package+,include*)>
+
+<!ELEMENT package (result-types?, interceptors?, default-interceptor-ref?, global-results?, action*)>
+<!ATTLIST package
+    name CDATA #REQUIRED
+    extends CDATA #IMPLIED
+    namespace CDATA #IMPLIED
+    abstract CDATA #IMPLIED
+>
+
+<!ELEMENT result-types (result-type+)>
+
+<!ELEMENT result-type (param*)>
+<!ATTLIST result-type
+    name CDATA #REQUIRED
+    class CDATA #REQUIRED
+    default (true|false) "false"
+>
+
+<!ELEMENT interceptors (interceptor*, interceptor-stack*)>
+
+<!ELEMENT interceptor (param*)>
+<!ATTLIST interceptor
+    name CDATA #REQUIRED
+    class CDATA #REQUIRED
+>
+
+<!ELEMENT interceptor-stack (interceptor-ref+)>
+<!ATTLIST interceptor-stack
+    name CDATA #REQUIRED
+>
+
+<!ELEMENT interceptor-ref (param*)>
+<!ATTLIST interceptor-ref
+    name CDATA #REQUIRED
+>
+
+<!ELEMENT default-interceptor-ref (param*)>
+<!ATTLIST default-interceptor-ref
+    name CDATA #REQUIRED
+>
+
+<!ELEMENT global-results (result+)>
+
+<!ELEMENT action (param*, result*, interceptor-ref*)>
+<!ATTLIST action
+name CDATA #REQUIRED
+    class CDATA #REQUIRED
+    method CDATA #IMPLIED
+    converter CDATA #IMPLIED
+>
+
+<!ELEMENT param (#PCDATA)>
+<!ATTLIST param
+    name CDATA #REQUIRED
+>
+
+<!ELEMENT result (param*)>
+<!ATTLIST result
+    name CDATA #REQUIRED
+    type CDATA #IMPLIED
+>
+
+<!ELEMENT include (#PCDATA)>
+<!ATTLIST include
+    file CDATA #REQUIRED
+>
+
+

etc/xwork-validator-1.0.dtd

+<?xml version="1.0" encoding="UTF-8"?>
+<!ELEMENT validators (field*,validator*)>
+
+<!ELEMENT field (field-validator+)>
+<!ATTLIST field
+	name CDATA #REQUIRED
+>
+
+<!ELEMENT field-validator (param*, message)>
+<!ATTLIST field-validator
+	type CDATA #REQUIRED
+>
+
+<!ELEMENT validator (param*, message)>
+<!ATTLIST validator
+	type CDATA #REQUIRED
+>
+
+<!ELEMENT param (#PCDATA)>
+<!ATTLIST param
+    name CDATA #REQUIRED
+>
+
+<!ELEMENT message (#PCDATA)>
+<!ATTLIST message
+    key CDATA #IMPLIED
+>
+
+

java/com/opensymphony/xwork/Action.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork;
+
+import java.io.Serializable;
+
+
+/**
+ * All Actions must minimally implement this interface. It provides the
+ * execute methodName, which is done by actions to perform whatever their
+ * purpose is.
+ *
+ * @author $Author$
+ * @version $Revision$
+ */
+public interface Action extends Serializable {
+    //~ Static fields/initializers /////////////////////////////////////////////
+
+    /**
+     * The action execution was successful. Show result
+     * view to the end user.
+     */
+    public static final String SUCCESS = "success";
+
+    /**
+     * The action execution was successful but do not
+     * show a view. This is useful for actions that are
+     * handling the view in another fashion like redirect.
+     */
+    public static final String NONE = "none";
+
+    /**
+     * The action execution was a failure.
+     * Show an error view, possibly asking the
+     * user to retry entering data.
+     */
+    public static final String ERROR = "error";
+
+    /**
+     * The action execution require more input
+     * in order to succeed.
+     * This result is typically used if a form
+     * handling action has been executed so as
+     * to provide defaults for a form. The
+     * form associated with the handler should be
+     * shown to the end user.
+     *
+     * This result is also used if the given input
+     * params are invalid, meaning the user
+     * should try providing input again.
+     */
+    public static final String INPUT = "input";
+
+    /**
+     * The action could not execute, since the
+     * user most was not logged in. The login view
+     * should be shown.
+     */
+    public static final String LOGIN = "login";
+
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    /**
+     * This methodName is where the logic of the action is executed.
+     * Parameters are passed by calling set-methods, or by implementing
+     * the ParameterAware interface.
+     *
+     * @return     a string representing the logical result of the execution.
+     * See constants in this interface for a list of standard result values.
+     * @exception   java.lang.Exception  thrown if a system level exception occurs.
+     * Application level exceptions should be handled by returning
+     * an error value, such as Action.ERROR.
+     */
+    public String execute() throws Exception;
+}

java/com/opensymphony/xwork/ActionChainResult.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.HashMap;
+
+
+/**
+ * A special kind of view that invokes GenericDispatch (using the previously existing
+ * ActionContext) and executes another action. This view takes one required parameter:
+ * <ul>
+ *  <li><b>actionName</b> - the name of the action that will be chained to</li>
+ * </ul>
+ *
+ * @author $Author$
+ * @version $Revision$
+ */
+public class ActionChainResult implements Result {
+    //~ Static fields/initializers /////////////////////////////////////////////
+
+    private static final Log log = LogFactory.getLog(ActionChainResult.class);
+
+    //~ Instance fields ////////////////////////////////////////////////////////
+
+    private ActionProxy proxy;
+    private String actionName;
+
+    /**
+     * used to determine which namespace the Action is in that we're chaining
+     * to.  if namespace is null, this defaults to the current namespace.
+     */
+    private String namespace;
+
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    public void setActionName(String actionName) {
+        this.actionName = actionName;
+    }
+
+    /**
+     * sets the namespace of the Action that we're chaining to.  if namespace
+     * is null, this defaults to the current namespace.
+     * @param namespace the name of the namespace we're chaining to
+     */
+    public void setNamespace(String namespace) {
+        this.namespace = namespace;
+    }
+
+    public ActionProxy getProxy() {
+        return proxy;
+    }
+
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+
+        if (!(o instanceof ActionChainResult)) {
+            return false;
+        }
+
+        final ActionChainResult actionChainResult = (ActionChainResult) o;
+
+        if ((actionName != null) ? (!actionName.equals(actionChainResult.actionName)) : (actionChainResult.actionName != null)) {
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * @param invocation the DefaultActionInvocation calling the action call stack
+     */
+    public void execute(ActionInvocation invocation) throws Exception {
+        HashMap extraContext = new HashMap();
+        extraContext.put(ActionContext.VALUE_STACK, ActionContext.getContext().getValueStack());
+        extraContext.put(ActionContext.PARAMETERS, ActionContext.getContext().getParameters());
+        extraContext.put("com.opensymphony.xwork.interceptor.component.ComponentManager", ActionContext.getContext().get("com.opensymphony.xwork.interceptor.component.ComponentManager"));
+
+        if (log.isDebugEnabled()) {
+            log.debug("Chaining to action " + actionName);
+        }
+
+        // if the namespace wasn't explicitly defined, assume the current one
+        if (this.namespace == null) {
+            this.namespace = invocation.getProxy().getNamespace();
+        }
+
+        proxy = ActionProxyFactory.getFactory().createActionProxy(this.namespace, actionName, extraContext);
+        proxy.execute();
+    }
+
+    public int hashCode() {
+        return ((actionName != null) ? actionName.hashCode() : 0);
+    }
+}

java/com/opensymphony/xwork/ActionContext.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork;
+
+import com.opensymphony.xwork.util.OgnlValueStack;
+
+import java.util.Locale;
+import java.util.Map;
+
+
+/**
+ * @author $Author$
+ * @version $Revision$
+ */
+public class ActionContext {
+    //~ Static fields/initializers /////////////////////////////////////////////
+
+    static ThreadLocal actionContext = new ActionContextThreadLocal();
+    public static final String ACTION_NAME = "com.opensymphony.xwork.ActionContext.name";
+    public static final String VALUE_STACK = OgnlValueStack.VALUE_STACK;
+    public static final String SESSION = "com.opensymphony.xwork.ActionContext.session";
+    public static final String APPLICATION = "com.opensymphony.xwork.ActionContext.application";
+    public static final String PARAMETERS = "com.opensymphony.xwork.ActionContext.parameters";
+    public static final String LOCALE = "com.opensymphony.xwork.ActionContext.locale";
+    public static final String TYPE_CONVERTER = "com.opensymphony.xwork.ActionContext.typeConverter";
+    public static final String ACTION_INVOCATION = "com.opensymphony.xwork.ActionContext.actionInvocation";
+
+    //~ Instance fields ////////////////////////////////////////////////////////
+
+    Map context;
+
+    //~ Constructors ///////////////////////////////////////////////////////////
+
+    public ActionContext(Map context) {
+        this.context = context;
+    }
+
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    public void setActionInvocation(ActionInvocation actionInvocation) {
+        put(ACTION_INVOCATION, actionInvocation);
+    }
+
+    public ActionInvocation getActionInvocation() {
+        return (ActionInvocation) get(ACTION_INVOCATION);
+    }
+
+    /**
+     * Set an application level Map.
+     */
+    public void setApplication(Map application) {
+        put(APPLICATION, application);
+    }
+
+    /**
+     * Returns a Map of the ServletContext when in a servlet environment or
+     * a generic application level Map otherwise.
+     *
+     * @return Map of ServletContext or generic application level Map
+     */
+    public Map getApplication() {
+        return (Map) get(APPLICATION);
+    }
+
+    public static void setContext(ActionContext aContext) {
+        actionContext.set(aContext);
+    }
+
+    /**
+     * Returns the ActionContext specific to the current thread.
+     *
+     * @return ActionContext for the current thread
+     */
+    public static ActionContext getContext() {
+        ActionContext context = (ActionContext) actionContext.get();
+
+        return context;
+    }
+
+    public void setContextMap(Map lookup) {
+        getContext().context = lookup;
+    }
+
+    public Map getContextMap() {
+        return context;
+    }
+
+    /**
+     * Sets the Locale for the current request
+     * @param locale
+     */
+    public void setLocale(Locale locale) {
+        put(LOCALE, locale);
+    }
+
+    /**
+     * Gets the Locale of the current request
+     * @return Locale
+     */
+    public Locale getLocale() {
+        Locale locale = (Locale) get(LOCALE);
+
+        if (locale == null) {
+            locale = Locale.getDefault();
+            setLocale(locale);
+        }
+
+        return locale;
+    }
+
+    /**
+     * Stores the name of the current Action in the ActionContext.
+     *
+     * @param name The name of the current action.
+     */
+    public void setName(String name) {
+        put(ACTION_NAME, name);
+    }
+
+    /**
+     * Returns the name of the current Action.
+     *
+     * @return The current Action name.
+     */
+    public String getName() {
+        return (String) get(ACTION_NAME);
+    }
+
+    /**
+     * Set a Map of parameters.
+     *
+     * @param parameters The parameters for the current action context.
+     */
+    public void setParameters(Map parameters) {
+        put(PARAMETERS, parameters);
+    }
+
+    /**
+     * Returns a Map of the HttpServletRequest parameters when in a servlet
+     * environment or a generic Map of parameters otherwise.
+     *
+     * @return Map of HttpServletRequest parameters, generic Map of parameters or
+     * multipart Map.
+     */
+    public Map getParameters() {
+        return (Map) get(PARAMETERS);
+    }
+
+    /**
+     * Set a session Map.
+     */
+    public void setSession(Map session) {
+        put(SESSION, session);
+    }
+
+    /**
+     * Returns the HttpSession when in a servlet environment or a generic
+     * session map otherwise.
+     *
+     * @return a map of HttpSession or a generic session map
+     */
+    public Map getSession() {
+        return (Map) get(SESSION);
+    }
+
+    public void setValueStack(OgnlValueStack stack) {
+        put(VALUE_STACK, stack);
+    }
+
+    public OgnlValueStack getValueStack() {
+        return (OgnlValueStack) get(VALUE_STACK);
+    }
+
+    /**
+     * Returns a value that is stored in the current ActionContext
+     * by doing a lookup using the value's key.
+     *
+     * @param key The key used to find the value.
+     * @return The value that was found using the key.
+     */
+    public Object get(Object key) {
+        return context.get(key);
+    }
+
+    /**
+     * Stores a value in the current ActionContext.  The value can
+     * be looked up using the key.
+     *
+     * @param key The key of the value.
+     * @param value The value to be stored.
+     */
+    public void put(Object key, Object value) {
+        context.put(key, value);
+    }
+
+    //~ Inner Classes //////////////////////////////////////////////////////////
+
+    private static class ActionContextThreadLocal extends ThreadLocal {
+        protected Object initialValue() {
+            OgnlValueStack vs = new OgnlValueStack();
+
+            return new ActionContext(vs.getContext());
+        }
+    }
+}

java/com/opensymphony/xwork/ActionInvocation.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork;
+
+import com.opensymphony.xwork.util.OgnlValueStack;
+
+
+/**
+ * ActionInvocation
+ * @author Jason Carreira
+ * Created Jun 9, 2003 11:37:27 AM
+ */
+public interface ActionInvocation {
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    Action getAction();
+
+    boolean isExecuted();
+
+    ActionProxy getProxy();
+
+    /**
+     * If the DefaultActionInvocation has been executed before and the Result is an instance of ActionChainResult, this method
+     * will walk down the chain of ActionChainResults until it finds a non-chain result, which will be returned. If the
+     * DefaultActionInvocation's result has not been executed before, the Result instance will be created and populated with
+     * the result params.
+     * @return a Result instance
+     * @throws java.lang.Exception
+     */
+    Result getResult() throws Exception;
+
+    String getResultCode();
+
+    OgnlValueStack getStack();
+
+    String invoke() throws Exception;
+}

java/com/opensymphony/xwork/ActionProxy.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork;
+
+import com.opensymphony.xwork.config.entities.ActionConfig;
+import com.opensymphony.xwork.util.OgnlValueStack;
+
+
+/**
+ * ActionProxy
+ * @author Jason Carreira
+ * Created Jun 9, 2003 11:27:55 AM
+ */
+public interface ActionProxy {
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    Action getAction();
+
+    String getActionName();
+
+    ActionConfig getConfig();
+
+    void setExecuteResult(boolean executeResult);
+
+    boolean getExecuteResult();
+
+    ActionInvocation getInvocation();
+
+    ActionContext getLastContext();
+
+    String getNamespace();
+
+    OgnlValueStack getValueStack();
+
+    String execute() throws Exception;
+}

java/com/opensymphony/xwork/ActionProxyFactory.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork;
+
+import java.util.Map;
+
+
+/**
+ * ActionProxyFactory
+ * @author Jason Carreira
+ * Created Jun 15, 2003 5:18:30 PM
+ */
+public abstract class ActionProxyFactory {
+    //~ Static fields/initializers /////////////////////////////////////////////
+
+    static ActionProxyFactory factory = new DefaultActionProxyFactory();
+
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    public static void setFactory(ActionProxyFactory factory) {
+        ActionProxyFactory.factory = factory;
+    }
+
+    public static ActionProxyFactory getFactory() {
+        return factory;
+    }
+
+    public abstract ActionInvocation createActionInvocation(ActionProxy actionProxy, Map extraContext) throws Exception;
+
+    public abstract ActionInvocation createActionInvocation(ActionProxy actionProxy) throws Exception;
+
+    public abstract ActionInvocation createActionInvocation(ActionProxy actionProxy, Map extraContext, boolean pushAction) throws Exception;
+
+    public abstract ActionProxy createActionProxy(String namespace, String actionName, Map extraContext) throws Exception;
+
+    public abstract ActionProxy createActionProxy(String namespace, String actionName, Map extraContext, boolean executeResult) throws Exception;
+}

java/com/opensymphony/xwork/ActionSupport.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork;
+
+
+/**
+ * ActionSupport
+ * @author Jason Carreira
+ * Created Feb 10, 2003 9:47:39 AM
+ */
+public class ActionSupport extends BaseActionSupport {
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    public String doDefault() throws Exception {
+        return INPUT;
+    }
+
+    public String doExecute() throws Exception {
+        return SUCCESS;
+    }
+
+    public String execute() throws Exception {
+        doValidation();
+
+        if (hasErrors()) {
+            return INPUT;
+        }
+
+        return doExecute();
+    }
+
+    /**
+     * Subclasses may override this method to provide validation
+     * of input data. The execute() method calls doValidation()
+     * in the beginning of its code (which will delegate to this method),
+     * so as to check input data before doing the actual processing.
+     *
+     * <p>If any application errors arise these should be registered
+     * by calling addActionError() or addFieldError().</p>
+     */
+    protected void doValidation() {
+    }
+}

java/com/opensymphony/xwork/BaseActionSupport.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork;
+
+import com.opensymphony.xwork.util.LocalizedTextUtil;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.Serializable;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.ResourceBundle;
+
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: Mike
+ * Date: May 27, 2003
+ * Time: 3:45:29 PM
+ * To change this template use Options | File Templates.
+ */
+public class BaseActionSupport implements Action, ValidationAware, LocaleAware, Serializable {
+    //~ Static fields/initializers /////////////////////////////////////////////
+
+    protected transient static final Log LOG = LogFactory.getLog(ActionSupport.class);
+
+    //~ Instance fields ////////////////////////////////////////////////////////
+
+    private Collection actionErrors;
+    private Map fieldErrors;
+
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    public void setActionErrors(Collection errorMessages) {
+        this.actionErrors = errorMessages;
+    }
+
+    public Collection getActionErrors() {
+        if (actionErrors == null) {
+            actionErrors = new ArrayList();
+        }
+
+        return actionErrors;
+    }
+
+    public void setFieldErrors(Map errorMap) {
+        this.fieldErrors = errorMap;
+    }
+
+    public Map getFieldErrors() {
+        if (fieldErrors == null) {
+            fieldErrors = new HashMap();
+        }
+
+        return fieldErrors;
+    }
+
+    /**
+    * Get the locale for this action.
+    *
+    * Applications may customize how locale is chosen by
+    * subclassing ActionSupport and override this methodName.
+    *
+    * @return     the locale to use
+    */
+    public Locale getLocale() {
+        return ActionContext.getContext().getLocale();
+    }
+
+    /**
+    * Get a text from the resource bundles associated with this action.
+    * The resource bundles are searched, starting with the one associated
+    * with this particular action, and testing all its superclasses' bundles.
+    * It will stop once a bundle is found that contains the given text. This gives
+    * a cascading style that allow global texts to be defined for an application base
+    * class.
+    *
+    * @param   aTextName  name of text to be found
+    * @return     value of named text
+    */
+    public String getText(String aTextName) {
+        Class thisClass = getClass();
+
+        return LocalizedTextUtil.findText(thisClass, aTextName);
+    }
+
+    /**
+    * Get the named bundle.
+    *
+    * You can override the getLocale() methodName to change the behaviour of how
+    * to choose locale for the bundles that are returned. Typically you would
+    * use the LocaleAware interface to get the users configured locale, or use
+    * your own methodName to allow the user to select the locale and store it in
+    * the session (by using the SessionAware interface).
+    *
+    * @param   aBundleName  bundle name
+    * @return     a resource bundle
+    */
+    public ResourceBundle getTexts(String aBundleName) {
+        return LocalizedTextUtil.findResourceBundle(aBundleName, getLocale());
+    }
+
+    /**
+    * Get the resource bundle associated with this action.
+    * This will be based on the actual subclass that is used.
+    *
+    * @return     resouce bundle
+    */
+    public ResourceBundle getTexts() {
+        return getTexts(getClass().getName());
+    }
+
+    public void addActionError(String anErrorMessage) {
+        getActionErrors().add(anErrorMessage);
+    }
+
+    public void addFieldError(String fieldName, String errorMessage) {
+        getFieldErrors().put(fieldName, errorMessage);
+    }
+
+    public String execute() throws Exception {
+        return SUCCESS;
+    }
+
+    public boolean hasActionErrors() {
+        return (actionErrors != null) && !actionErrors.isEmpty();
+    }
+
+    /**
+    * Note that this does not have the same meaning as in WW 1.x
+    * @return (hasActionErrors() || hasFieldErrors())
+    */
+    public boolean hasErrors() {
+        return (hasActionErrors() || hasFieldErrors());
+    }
+
+    public boolean hasFieldErrors() {
+        return (fieldErrors != null) && !fieldErrors.isEmpty();
+    }
+}

java/com/opensymphony/xwork/DefaultActionInvocation.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork;
+
+import com.opensymphony.xwork.config.entities.ActionConfig;
+import com.opensymphony.xwork.config.entities.ResultConfig;
+import com.opensymphony.xwork.interceptor.Interceptor;
+import com.opensymphony.xwork.util.OgnlUtil;
+import com.opensymphony.xwork.util.OgnlValueStack;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ *
+ *
+ * @author $Author$
+ * @version $Revision$
+ */
+public class DefaultActionInvocation implements ActionInvocation {
+    //~ Static fields/initializers /////////////////////////////////////////////
+
+    private static final Log LOG = LogFactory.getLog(DefaultActionInvocation.class);
+
+    //~ Instance fields ////////////////////////////////////////////////////////
+
+    protected Action action;
+    protected ActionProxy proxy;
+    ActionContext nestedContext;
+    Iterator interceptors;
+    Map extraContext;
+    OgnlValueStack stack;
+    Result result;
+    String resultCode;
+    boolean executed = false;
+    boolean pushAction = true;
+
+    //~ Constructors ///////////////////////////////////////////////////////////
+
+    protected DefaultActionInvocation(ActionProxy proxy) throws Exception {
+        this(proxy, null);
+    }
+
+    protected DefaultActionInvocation(ActionProxy proxy, Map extraContext) throws Exception {
+        this(proxy, extraContext, true);
+    }
+
+    protected DefaultActionInvocation(ActionProxy proxy, Map extraContext, boolean pushAction) throws Exception {
+        this.proxy = proxy;
+        this.extraContext = extraContext;
+        this.pushAction = pushAction;
+        init();
+    }
+
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    public Action getAction() {
+        return action;
+    }
+
+    public boolean isExecuted() {
+        return executed;
+    }
+
+    public ActionProxy getProxy() {
+        return proxy;
+    }
+
+    /**
+    * If the DefaultActionInvocation has been executed before and the Result is an instance of ActionChainResult, this method
+    * will walk down the chain of ActionChainResults until it finds a non-chain result, which will be returned. If the
+    * DefaultActionInvocation's result has not been executed before, the Result instance will be created and populated with
+    * the result params.
+    * @return a Result instance
+    * @throws Exception
+    */
+    public Result getResult() throws Exception {
+        if (result != null) {
+            Result returnResult = result;
+
+            // If we've chained to other Actions, we need to find the last result
+            while (returnResult instanceof ActionChainResult) {
+                ActionProxy aProxy = ((ActionChainResult) returnResult).getProxy();
+
+                if (aProxy != null) {
+                    Result proxyResult = aProxy.getInvocation().getResult();
+
+                    if ((proxyResult != null) && (aProxy.getExecuteResult())) {
+                        returnResult = proxyResult;
+                    } else {
+                        break;
+                    }
+                } else {
+                    break;
+                }
+            }
+
+            return returnResult;
+        } else {
+            Map results = proxy.getConfig().getResults();
+            ResultConfig resultConfig = (ResultConfig) results.get(resultCode);
+
+            if (resultConfig != null) {
+                Class resultClass = resultConfig.getClazz();
+
+                if (resultClass != null) {
+                    try {
+                        result = (Result) resultClass.newInstance();
+                    } catch (Exception e) {
+                        LOG.error("There was an exception while instantiating the result of type " + resultClass, e);
+                        throw e;
+                    }
+
+                    OgnlUtil.setProperties(resultConfig.getParams(), result, ActionContext.getContext().getContextMap());
+                }
+            }
+
+            return result;
+        }
+    }
+
+    public String getResultCode() {
+        return resultCode;
+    }
+
+    public OgnlValueStack getStack() {
+        return stack;
+    }
+
+    public String invoke() throws Exception {
+        if (executed) {
+            throw new IllegalStateException("Action has already executed");
+        }
+
+        if (interceptors.hasNext()) {
+            Interceptor interceptor = (Interceptor) interceptors.next();
+            resultCode = interceptor.intercept(this);
+        } else {
+            if (proxy.getConfig().getMethodName() == null) {
+                resultCode = getAction().execute();
+            } else {
+                resultCode = invokeAction(getAction(), proxy.getConfig());
+            }
+        }
+
+        if (!executed) {
+            // now execute the result, if we're supposed to
+            if (proxy.getExecuteResult()) {
+                executeResult();
+            }
+
+            executed = true;
+        }
+
+        return resultCode;
+    }
+
+    protected void createAction() {
+        // load action
+        try {
+            action = (Action) proxy.getConfig().getClazz().newInstance();
+        } catch (Exception e) {
+            throw new IllegalArgumentException("Unknown action name: " + e.getMessage());
+        }
+    }
+
+    protected Map createContextMap() {
+        Map contextMap;
+
+        if ((extraContext != null) && (extraContext.containsKey(ActionContext.VALUE_STACK))) {
+            // In case the ValueStack was passed in
+            stack = (OgnlValueStack) extraContext.get(ActionContext.VALUE_STACK);
+
+            if (stack == null) {
+                throw new IllegalStateException("There was a null Stack set into the extra params.");
+            }
+
+            contextMap = stack.getContext();
+        } else {
+            // create the value stack
+            stack = new OgnlValueStack();
+
+            // create the action context
+            contextMap = stack.getContext();
+        }
+
+        // put extraContext in
+        if (extraContext != null) {
+            contextMap.putAll(extraContext);
+        }
+
+        if (pushAction) {
+            stack.push(action);
+        }
+
+        //put this DefaultActionInvocation into the context map
+        contextMap.put(ActionContext.ACTION_INVOCATION, this);
+
+        return contextMap;
+    }
+
+    /**
+    * Uses getResult to get the final Result and executes it
+    */
+    private void executeResult() throws Exception {
+        Result aResult = getResult();
+
+        if (aResult != null) {
+            aResult.execute(this);
+        }
+    }
+
+    private void init() throws Exception {
+        createAction();
+
+        Map contextMap = createContextMap();
+        ActionContext context = new ActionContext(contextMap);
+        ActionContext.setContext(context);
+
+        // get a new List so we don't get problems with the iterator if someone changes the list
+        List interceptorList = new ArrayList(proxy.getConfig().getInterceptors());
+
+        if (interceptorList != null) {
+            interceptors = interceptorList.iterator();
+        }
+    }
+
+    private String invokeAction(Action action, ActionConfig actionConfig) throws Exception {
+        LOG.info("Executing action method = " + actionConfig.getMethodName());
+
+        try {
+            Method method = actionConfig.getMethod();
+
+            if (action instanceof Proxy) {
+                try {
+                    return (String) Proxy.getInvocationHandler(action).invoke(action, method, new Object[0]);
+                } catch (Throwable throwable) {
+                    throw new Exception("Error invoking on proxy: " + throwable.getMessage(), throwable);
+                }
+            } else {
+                return (String) method.invoke(action, new Object[0]);
+            }
+        } catch (NoSuchMethodException e) {
+            throw new IllegalArgumentException("Method '" + actionConfig.getMethodName() + "()' is not defined in action '" + getAction().getClass() + "'");
+        } catch (InvocationTargetException e) {
+            // We try to return the source exception.
+            Throwable t = e.getTargetException();
+
+            if (t instanceof Exception) {
+                throw (Exception) t;
+            } else {
+                throw e;
+            }
+        }
+    }
+}

java/com/opensymphony/xwork/DefaultActionProxy.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork;
+
+import com.opensymphony.xwork.config.ConfigurationException;
+import com.opensymphony.xwork.config.ConfigurationManager;
+import com.opensymphony.xwork.config.entities.ActionConfig;
+import com.opensymphony.xwork.util.LocalizedTextUtil;
+import com.opensymphony.xwork.util.OgnlValueStack;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.Map;
+
+
+/**
+ * The DefaultActionProxy is an extra layer between XWork and the action so that different proxies are possible.
+ *
+ * An example of this would be a remote proxy, where the layer between XWork and the action might be RMI or SOAP.
+ *
+ * @author $Author$
+ * @version $Revision$
+ */
+public class DefaultActionProxy implements ActionProxy {
+    //~ Static fields/initializers /////////////////////////////////////////////
+
+    private static final Log LOG = LogFactory.getLog(DefaultActionProxy.class);
+
+    //~ Instance fields ////////////////////////////////////////////////////////
+
+    ActionConfig config;
+    ActionContext lastContext;
+    ActionInvocation invocation;
+    Map extraContext;
+    String actionName;
+    String namespace;
+    boolean executeResult;
+    private ActionContext nestedContext;
+
+    //~ Constructors ///////////////////////////////////////////////////////////
+
+    /**
+    * This constructor is private so the builder methods (create*) should be used to create an DefaultActionProxy.
+    *
+    * The reason for the builder methods is so that you can use a subclass to create your own DefaultActionProxy instance
+    * (like a RMIActionProxy).
+    */
+    protected DefaultActionProxy(String namespace, String actionName, Map extraContext, boolean executeResult) throws Exception {
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Creating an DefaultActionProxy for namespace " + namespace + " and action name " + actionName);
+        }
+
+        this.actionName = actionName;
+        this.namespace = namespace;
+        this.executeResult = executeResult;
+        this.extraContext = extraContext;
+        config = ConfigurationManager.getConfiguration().getRuntimeConfiguration().getActionConfig(namespace, actionName);
+
+        if (config == null) {
+            String message;
+
+            if ((namespace != null) && (namespace.trim().length() > 0)) {
+                message = LocalizedTextUtil.findDefaultText(XWorkMessages.MISSING_PACKAGE_ACTION_EXCEPTION, new String[] {
+                            namespace, actionName
+                        });
+            } else {
+                message = LocalizedTextUtil.findDefaultText(XWorkMessages.MISSING_ACTION_EXCEPTION, new String[] {
+                            actionName
+                        });
+            }
+
+            throw new ConfigurationException(message);
+        }
+
+        prepare();
+    }
+
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    public Action getAction() {
+        return invocation.getAction();
+    }
+
+    public String getActionName() {
+        return actionName;
+    }
+
+    public ActionConfig getConfig() {
+        return config;
+    }
+
+    public void setExecuteResult(boolean executeResult) {
+        this.executeResult = executeResult;
+    }
+
+    public boolean getExecuteResult() {
+        return executeResult;
+    }
+
+    public ActionInvocation getInvocation() {
+        return invocation;
+    }
+
+    public ActionContext getLastContext() {
+        return lastContext;
+    }
+
+    public String getNamespace() {
+        return namespace;
+    }
+
+    public OgnlValueStack getValueStack() {
+        return invocation.getStack();
+    }
+
+    public String execute() throws Exception {
+        String retCode = null;
+        retCode = invocation.invoke();
+
+        // save the context before overwriting it
+        lastContext = ActionContext.getContext();
+        ActionContext.setContext(nestedContext);
+
+        return retCode;
+    }
+
+    protected void prepare() throws Exception {
+        nestedContext = ActionContext.getContext();
+
+        // this will set up a new ActionContext on the ThreadLocal
+        invocation = ActionProxyFactory.getFactory().createActionInvocation(this, extraContext);
+    }
+}

java/com/opensymphony/xwork/DefaultActionProxyFactory.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork;
+
+import java.util.Map;
+
+
+/**
+ * DefaultActionProxyFactory
+ * @author Jason Carreira
+ * Created Jun 15, 2003 5:19:13 PM
+ */
+public class DefaultActionProxyFactory extends ActionProxyFactory {
+    //~ Constructors ///////////////////////////////////////////////////////////
+
+    public DefaultActionProxyFactory() {
+        super();
+    }
+
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    public ActionInvocation createActionInvocation(ActionProxy actionProxy) throws Exception {
+        return new DefaultActionInvocation(actionProxy);
+    }
+
+    public ActionInvocation createActionInvocation(ActionProxy actionProxy, Map extraContext) throws Exception {
+        return new DefaultActionInvocation(actionProxy, extraContext);
+    }
+
+    public ActionInvocation createActionInvocation(ActionProxy actionProxy, Map extraContext, boolean pushAction) throws Exception {
+        return new DefaultActionInvocation(actionProxy, extraContext, pushAction);
+    }
+
+    /**
+    * Use this method to build an DefaultActionProxy instance.
+    */
+    public ActionProxy createActionProxy(String namespace, String actionName, Map extraContext) throws Exception {
+        return new DefaultActionProxy(namespace, actionName, extraContext, true);
+    }
+
+    /**
+    * Use this method to build an DefaultActionProxy instance.
+    */
+    public ActionProxy createActionProxy(String namespace, String actionName, Map extraContext, boolean executeResult) throws Exception {
+        return new DefaultActionProxy(namespace, actionName, extraContext, executeResult);
+    }
+}

java/com/opensymphony/xwork/LocaleAware.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork;
+
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+
+/**
+ * LocaleAware
+ * @author Jason Carreira
+ * Created Feb 10, 2003 9:55:48 AM
+ */
+public interface LocaleAware {
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    /**
+     * Get the locale for this action.
+     *
+     * Applications may customize how locale is chosen by
+     * subclassing ActionSupport and override this methodName.
+     *
+     * @return     the locale to use
+     */
+    Locale getLocale();
+
+    /**
+     * Get a text from the resource bundles associated with this action.
+     * The resource bundles are searched, starting with the one associated
+     * with this particular action, and testing all its superclasses' bundles.
+     * It will stop once a bundle is found that contains the given text. This gives
+     * a cascading style that allow global texts to be defined for an application base
+     * class.
+     *
+     * @param   aTextName  name of text to be found
+     * @return     value of named text
+     */
+    String getText(String aTextName);
+
+    /**
+    * Get the named bundle.
+    *
+    * You can override the getLocale() methodName to change the behaviour of how
+    * to choose locale for the bundles that are returned. Typically you would
+    * use the LocaleAware interface to get the users configured locale, or use
+    * your own methodName to allow the user to select the locale and store it in
+    * the session (by using the SessionAware interface).
+    *
+    * @param   aBundleName  bundle name
+    * @return     a resource bundle
+    */
+    ResourceBundle getTexts(String aBundleName);
+
+    /**
+    * Get the resource bundle associated with this action.
+    * This will be based on the actual subclass that is used.
+    *
+    * @return     resouce bundle
+    */
+    ResourceBundle getTexts();
+}

java/com/opensymphony/xwork/ModelDriven.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork;
+
+
+/**
+ * ModelDriven Actions provide a model object to be pushed onto the ValueStack instead of the Action itself,
+ * allowing a FormBean type approach like Struts.
+ * @author Jason Carreira
+ * Created Apr 8, 2003 6:22:42 PM
+ */
+public interface ModelDriven {
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    /**
+     * @return the model to be pushed onto the ValueStack instead of the Action itself
+     */
+    Object getModel();
+}

java/com/opensymphony/xwork/Result.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork;
+
+
+/**
+ * All results (except for NONE) of an Action are mapped to a View implementation.
+ * Examples of Views might be:
+ * <ul>
+ *  <li>SwingPanelView - pops up a new Swing panel</li>
+ *  <li>ActionChainView - executes another action</li>
+ *  <li>SerlvetRedirectView - redirects the HTTP response to a URL</li>
+ *  <li>ServletDispatcherView - dispatches the HTTP response to a URL</li>
+ * </ul>
+ *
+ * @author $Author$
+ * @version $Revision$
+ */
+public interface Result {
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    /**
+    * Represents a generic interface for all action execution results, whether that be displaying a webpage, generating
+    * an email, sending a JMS message, etc.
+    */
+    public void execute(ActionInvocation invocation) throws Exception;
+}

java/com/opensymphony/xwork/ValidationAware.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork;
+
+import java.util.Collection;
+import java.util.Map;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author $author$
+ * @version $Revision$
+ */
+public interface ValidationAware {
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    /**
+     * Set the Collection of Action level String error messages
+     * @param errorMessages
+     */
+    void setActionErrors(Collection errorMessages);
+
+    /**
+    * Get the Collection of Action level error messages for this action
+    *
+    * @return Collection of String error messages
+    */
+    Collection getActionErrors();
+
+    /**
+     *  Set the field error map of fieldname (String) to Collection of String error messages
+     * @param errorMap
+     */
+    void setFieldErrors(Map errorMap);