Commits

Anonymous committed a75e956

Make template system support JSP and Velocity templates. Also some code format cleanup.

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@537573baa09-0c28-0410-bef9-dab3c582ae83

Comments (0)

Files changed (196)

 Test Plan.jmx
 Test Plan.jtl
 Test Plan2.jmx
+.compatibility
+.j2ee
+.runtime
+.websettings

misc/weblogic6.1/build.xml

             <exclude name="build/servlet.jar"/>
         </fileset>
         <fileset dir="${basedir}/build">
-        	<include name="webwork-2.0-beta.jar"/>
+            <include name="webwork-2.0-beta.jar"/>
         </fileset>
         <fileset dir="${env.WEBLOGIC_HOME}/lib">
-        	<include name="weblogic.jar"/>
+            <include name="weblogic.jar"/>
         </fileset>
     </path>
 
 
     <property name="config-browser" value="${basedir}/config-browser"/>
 
-	<property name="misc-weblogic-61" value="${basedir}/misc/weblogic6.1"/>
-	
+    <property name="misc-weblogic-61" value="${basedir}/misc/weblogic6.1"/>
+
     <property name="lib" value="${basedir}/lib"/>
     <property name="lib.core" value="${lib}/core"/>
     <property name="lib.build" value="${lib}/build"/>
     </target>
 
     <target name="example-war" depends="clean, jar, config-browser">
-    	<mkdir dir="${build.webapp}"/>
-    	<copy todir="${build.webapp}">
-    		<fileset dir="${src.webapp}">
-    		</fileset>
-    	</copy>
-    	<mkdir dir="${build.webinf}"/>
-    	<copy file="${src.webapp}/WEB-INF/web.xml" todir="${build.webinf}"/>
+        <mkdir dir="${build.webapp}"/>
+        <copy todir="${build.webapp}">
+            <fileset dir="${src.webapp}">
+            </fileset>
+        </copy>
+        <mkdir dir="${build.webinf}"/>
+        <copy file="${src.webapp}/WEB-INF/web.xml" todir="${build.webinf}"/>
         <mkdir dir="${build.example}"/>
         <javac srcdir="${src.example}" destdir="${build.example}" classpath="${build.java}" classpathref="cp" debug="on"/>
-		
+
         <copy filtering="no" todir="${build.example}">
             <fileset dir="${src.example}">
                 <exclude name="**/*.java"/>
             </fileset>
         </copy>
         <copy filtering="no" TODIR="${build.example}">
-        	<fileset dir="${src}/webapp">
-        		<include name="**/*.jsp"/>
-        		<include name="**/*.vm"/>
-        		<include name="**/*.tld"/>
-        		<include name="**/*.xml"/>
-        	</fileset>
+            <fileset dir="${src}/webapp">
+                <include name="**/*.jsp"/>
+                <include name="**/*.vm"/>
+                <include name="**/*.tld"/>
+                <include name="**/*.xml"/>
+            </fileset>
         </copy>
         <copy filtering="no" TODIR="${build.example}">
-        	<fileset dir="${src.weblogic61.webapp}">
-        		<include name="**/*.jsp"/>
-        		<include name="**/*.vm"/>
-        		<include name="**/*.tld"/>
-        		<include name="**/*.xml"/>
-        	</fileset>
+            <fileset dir="${src.weblogic61.webapp}">
+                <include name="**/*.jsp"/>
+                <include name="**/*.vm"/>
+                <include name="**/*.tld"/>
+                <include name="**/*.xml"/>
+            </fileset>
         </copy>
 
         <copy tofile="${build}/webwork.tld" file="${src.etc}/taglib.tld"/>
             <classes dir="${build.example}"/>
             <classes dir="${src.etc}/example"/>
         </war>
-        
+
     </target>
 
     <target name="javadocs">

misc/weblogic6.1/src/java/com/opensymphony/webwork/config/ServletContextSingleton.java

 
 /**
  * This singleton holds an instance of the web servlet context.
- * <p>
+ * <p/>
  * This is needed for running WebWork on Weblogic Server 6.1
  * because there is no provision to retrieve the servlet context
  * from the web session object.
- * <p>
+ * <p/>
  * This class is created to bet that this singleton can be set by
  * {@link com.opensymphony.webwork.lifecycle.RequestLifecycleFilterCompatWeblogic61}
  * before the servlet context is needed by
  * {@link com.opensymphony.webwork.lifecycle.SessionLifecycleListener}
  * which will use this object to get it.
- * 
+ *
  * @author Scott N. Smith scottnelsonsmith@yahoo.com
  * @version $Id$
  */
-public class ServletContextSingleton
-{
+public class ServletContextSingleton {
     /**
      * The web servlet context.  Holding this is the
      * purpose of this singleton.
      */
     private ServletContext servletContext;
-    
+
     /**
      * The sole instance of this class.
      */
     private static ServletContextSingleton singleton;
-    
+
     /**
      * Constructor which cannot be called
      * publicly.
      */
-    private ServletContextSingleton()
-    {
+    private ServletContextSingleton() {
     }
-    
+
     /**
      * answers the singleton.
-     * <p>
+     * <p/>
      * At some point, the caller must populate the web servlet
      * context.
-     * 
+     *
      * @return answers the singleton instance of this class
      */
-    public static ServletContextSingleton getInstance()
-    {
-        if (singleton == null)
-        {
+    public static ServletContextSingleton getInstance() {
+        if (singleton == null) {
             singleton = new ServletContextSingleton();
         }
         return singleton;
     }
-    
+
     /**
      * @return the web servlet context
      */
-    public ServletContext getServletContext()
-    {
+    public ServletContext getServletContext() {
         return servletContext;
     }
 
     /**
      * @param context the web servlet context
      */
-    public void setServletContext(ServletContext context)
-    {
+    public void setServletContext(ServletContext context) {
         servletContext = context;
     }
 

misc/weblogic6.1/src/java/com/opensymphony/webwork/dispatcher/FilterDispatcherCompatWeblogic61.java

 package com.opensymphony.webwork.dispatcher;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 import javax.servlet.Filter;
 import javax.servlet.FilterConfig;
 import javax.servlet.ServletException;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 
 /**
  * When running Weblogic Server 6.1, this class should be
  * specified in web.xml instead of {@link FilterDispatcher}.
- * <p>
+ * <p/>
  * This class properly handles the weblogic.jar handling
  * of servlet filters.  There is one serious incompatibility, and
  * that is that while {@link FilterConfig#init(FilterConfig)}
  * invokes {@link FilterConfig#init(FilterConfig)}, the setter
  * must "swallow" the exception.  This it does by logging the
  * exception as an error.
- * 
+ *
  * @author Scott N. Smith scottnelsonsmith@yahoo.com
  * @version $Id$
  */
 public class FilterDispatcherCompatWeblogic61
-    extends FilterDispatcher
-    implements Filter
-{
-    /** the standard logger */
+        extends FilterDispatcher
+        implements Filter {
+    /**
+     * the standard logger
+     */
     private static Log log =
-        LogFactory.getLog(FilterDispatcherCompatWeblogic61.class);
+            LogFactory.getLog(FilterDispatcherCompatWeblogic61.class);
 
     /**
      * This method is required by Weblogic 6.1 SP4 because
      *
      * @return the filter's filter configuration
      */
-    public FilterConfig getFilterConfig()
-    {
+    public FilterConfig getFilterConfig() {
         return super.getFilterConfig();
     }
 
      *
      * @param filterConfig the filter configuration for this filter
      */
-    public final void setFilterConfig(FilterConfig filterConfig)
-    {
-        try
-        {
+    public final void setFilterConfig(FilterConfig filterConfig) {
+        try {
             init(filterConfig);
-        }
-        catch (ServletException se)
-        {
-            log.error(
-                "Couldn't set the filter configuration in this filter",
-                se);
+        } catch (ServletException se) {
+            log.error("Couldn't set the filter configuration in this filter",
+                    se);
         }
     }
 

misc/weblogic6.1/src/java/com/opensymphony/webwork/lifecycle/RequestLifecycleFilterCompatWeblogic61.java

 package com.opensymphony.webwork.lifecycle;
 
+import com.opensymphony.webwork.config.ServletContextSingleton;
+
 import javax.servlet.Filter;
 import javax.servlet.FilterConfig;
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpSession;
 
-import com.opensymphony.webwork.config.ServletContextSingleton;
-
 /**
  * @author Scott N. Smith scottnelsonsmith@yahoo.com
  * @version $Id$
  */
 public class RequestLifecycleFilterCompatWeblogic61
-    extends RequestLifecycleFilter
-    implements Filter
-{
+        extends RequestLifecycleFilter
+        implements Filter {
 
     /**
      * dummy setter for {@link #filterConfig}; this method
      * sets up the {@link ServletContextSingleton} with
      * the servlet context from the filter configuration.
-     * <p>
+     * <p/>
      * This is needed by Weblogic Server 6.1 because it
      * uses a slightly obsolete Servlet 2.3-minus spec
      * whose {@link Filter} interface requires this method.
-     * <p>
-     * 
+     * <p/>
+     *
      * @param filterConfig the filter configuration.
      */
-    public void setFilterConfig(FilterConfig filterConfig)
-    {
+    public void setFilterConfig(FilterConfig filterConfig) {
         ServletContextSingleton singleton =
-            ServletContextSingleton.getInstance();
+                ServletContextSingleton.getInstance();
         singleton.setServletContext(filterConfig.getServletContext());
     }
-    
+
     /**
      * answers the filter configuration.
-     * 
+     *
      * @return <code>null</code> since this filter doesn't
-     *          use a filter config
+     *         use a filter config
      */
-    public FilterConfig getFilterConfig()
-    {
+    public FilterConfig getFilterConfig() {
         return null;
     }
-    
+
     /**
      * answers the servlet context.
-     * <p>
+     * <p/>
      * Servlet 2.3 specifies that this can be retrieved from
      * the session.  Unfortunately, weblogic.jar can only retrieve
      * the servlet context from the filter config.  Hence, this
      * returns the servlet context from the singleton that was
      * setup by {@link #setFilterConfig(FilterConfig)}.
-     * 
+     *
      * @param session the HTTP session.  Not used
      * @return the servlet context.
      */
-    protected ServletContext getServletContext(HttpSession session)
-    {
+    protected ServletContext getServletContext(HttpSession session) {
         ServletContextSingleton singleton =
-            ServletContextSingleton.getInstance();
+                ServletContextSingleton.getInstance();
         return singleton.getServletContext();
     }
 

misc/weblogic6.1/src/java/com/opensymphony/webwork/lifecycle/SessionLifecycleListenerCompatWeblogic61.java

 package com.opensymphony.webwork.lifecycle;
 
+import com.opensymphony.webwork.config.ServletContextSingleton;
+
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpSession;
 
-import com.opensymphony.webwork.config.ServletContextSingleton;
-
 /**
- * 
  * @author Scott N. Smith scottnelsonsmith@yahoo.com
  * @version $Id$
  */
 public class SessionLifecycleListenerCompatWeblogic61
-    extends SessionLifecycleListener
-{
+        extends SessionLifecycleListener {
     /**
      * This is needed by Weblogic Server 6.1 because it
      * uses a slightly obsolete Servlet 2.3-minus spec.
      * available from the web session object, and so
      * it is retrieved from a special singleton whose sole
      * purpose is to hold the servlet context for this listenter.
+     *
      * @param session the HTTP session.  Here is it not used.
      * @return the servlet context
      * @see ServletContextSingleton
      * @see SessionLifecycleListener#getServletContext(javax.servlet.http.HttpSession)
      */
-    protected ServletContext getServletContext(HttpSession session)
-    {
+    protected ServletContext getServletContext(HttpSession session) {
         return ServletContextSingleton.getInstance().getServletContext();
     }
 }

misc/weblogic6.1/src/webapp/WEB-INF/web.xml

 
     <display-name>WebWork 2.0 Example App</display-name>
 
-<!--    <filter>-->
-<!--        <filter-name>webwork</filter-name>-->
-<!--        <filter-class>com.opensymphony.webwork.dispatcher.FilterDispatcherCompatWeblogic61</filter-class>-->
-<!--    </filter>-->
+    <!--    <filter>-->
+    <!--        <filter-name>webwork</filter-name>-->
+    <!--        <filter-class>com.opensymphony.webwork.dispatcher.FilterDispatcherCompatWeblogic61</filter-class>-->
+    <!--    </filter>-->
 
     <filter>
         <filter-name>container</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>
 
-<!--
-    <filter-mapping>
-        <filter-name>webwork</filter-name>
-        <url-pattern>/*</url-pattern>
-    </filter-mapping>
--->
+    <!--
+        <filter-mapping>
+            <filter-name>webwork</filter-name>
+            <url-pattern>/*</url-pattern>
+        </filter-mapping>
+    -->
 
     <listener>
         <listener-class>com.opensymphony.webwork.lifecycle.ApplicationLifecycleListener</listener-class>

src/config-browser/com/opensymphony/webwork/config_browser/ActionNamesAction.java

 package com.opensymphony.webwork.config_browser;
 
-import java.util.Set;
-import java.util.TreeSet;
-
+import com.opensymphony.xwork.ActionSupport;
+import com.opensymphony.xwork.config.entities.ActionConfig;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import com.opensymphony.xwork.ActionSupport;
-import com.opensymphony.xwork.config.entities.ActionConfig;
+import java.util.Set;
+import java.util.TreeSet;
 
 /**
  * ActionNamesAction
- * 
+ *
  * @author Jason Carreira Created Aug 11, 2003 9:35:15 PM
  */
 public class ActionNamesAction extends ActionSupport {

src/config-browser/com/opensymphony/webwork/config_browser/ListValidatorsAction.java

 
 /**
  * ListValidatorsAction loads the validations for a given class and context
+ *
  * @author Jason Carreira
- * Date: May 31, 2004 5:06:16 PM
+ *         Date: May 31, 2004 5:06:16 PM
  */
 public class ListValidatorsAction extends ActionSupport {
     private Class clazz;
     }
 
     protected void loadValidators() {
-        validators = ActionValidatorManager.getValidators(clazz,context);
+        validators = ActionValidatorManager.getValidators(clazz, context);
     }
 }

src/config-browser/com/opensymphony/webwork/config_browser/ShowValidatorAction.java

 package com.opensymphony.webwork.config_browser;
 
+import com.opensymphony.xwork.util.OgnlUtil;
+import com.opensymphony.xwork.validator.Validator;
 import ognl.Ognl;
 import ognl.OgnlException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
-import java.util.*;
 import java.beans.BeanInfo;
-import java.beans.Introspector;
 import java.beans.IntrospectionException;
+import java.beans.Introspector;
 import java.beans.PropertyDescriptor;
-
-import com.opensymphony.xwork.util.OgnlUtil;
-import com.opensymphony.xwork.validator.Validator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
 
 /**
  * ShowValidatorAction
+ *
  * @author Jason Carreira
- * Date: Jun 1, 2004 9:01:02 PM
+ *         Date: Jun 1, 2004 9:01:02 PM
  */
 public class ShowValidatorAction extends ListValidatorsAction {
     private static Log log = LogFactory.getLog(ShowValidatorAction.class);
                 try {
                     Object expr = OgnlUtil.compile(name);
                     Object value = Ognl.getValue(expr, context, validator);
-                    properties.add(new PropertyInfo(name,pd.getPropertyType(),value));
+                    properties.add(new PropertyInfo(name, pd.getPropertyType(), value));
                 } catch (OgnlException e) {
                     addActionError("Caught OGNL exception while getting property value for '" + name + "' on validator of type " + validator.getClass().getName());
                 }
             }
         } catch (Exception e) {
-            log.warn("Unable to retrieve properties.",e);
+            log.warn("Unable to retrieve properties.", e);
             addActionError("Unable to retrieve properties: " + e.toString());
         }
 

src/config-browser/config-browser.xml

             </interceptor-stack>
         </interceptors>
         <default-interceptor-ref name="config-browser-default"/>
-        
-		<global-results>
-			<result name="error" type="velocity">/error.vm</result>
-			<result name="input" type="velocity">/error.vm</result>
-		</global-results>
 
-		<action name="actionNames" class="com.opensymphony.webwork.config_browser.ActionNamesAction">
-			<result type="velocity" name="success">/actionNames.vm</result>
-		</action>
+        <global-results>
+            <result name="error" type="velocity">/error.vm</result>
+            <result name="input" type="velocity">/error.vm</result>
+        </global-results>
 
-		<action name="showConfig" class="com.opensymphony.webwork.config_browser.ShowConfigAction">
-			<result type="velocity" name="success">/showConfig.vm</result>
-		</action>
+        <action name="actionNames" class="com.opensymphony.webwork.config_browser.ActionNamesAction">
+            <result type="velocity" name="success">/actionNames.vm</result>
+        </action>
+
+        <action name="showConfig" class="com.opensymphony.webwork.config_browser.ShowConfigAction">
+            <result type="velocity" name="success">/showConfig.vm</result>
+        </action>
 
         <action name="showValidators" class="com.opensymphony.webwork.config_browser.ListValidatorsAction">
             <result name="error" type="velocity">/simple-error.vm</result>
-			<result name="input" type="velocity">/simple-error.vm</result>
-			<result type="velocity" name="success">/showValidators.vm</result>
-		</action>
+            <result name="input" type="velocity">/simple-error.vm</result>
+            <result type="velocity" name="success">/showValidators.vm</result>
+        </action>
 
         <action name="validatorDetails" class="com.opensymphony.webwork.config_browser.ShowValidatorAction">
-			<result type="velocity" name="success">/validatorDetails.vm</result>
-		</action>
+            <result type="velocity" name="success">/validatorDetails.vm</result>
+        </action>
     </package>
 </xwork>

src/etc/example/i18n.xml

                 <param name="location">shop.vm</param>
             </result>
         </action>
-<!--        <action name="i18n.Cart" class="com.opensymphony.webwork.example.i18n.Cart">-->
-<!--            <result name="success" type="velocity">-->
-<!--                <param name="location">cart.vm</param>-->
-<!--            </result>-->
-<!--        </action>-->
+        <!--        <action name="i18n.Cart" class="com.opensymphony.webwork.example.i18n.Cart">-->
+        <!--            <result name="success" type="velocity">-->
+        <!--                <param name="location">cart.vm</param>-->
+        <!--            </result>-->
+        <!--        </action>-->
         <action name="i18n.CDList" class="com.opensymphony.webwork.example.i18n.CDList">
             <result name="success" type="velocity">
                 <param name="location">cdlist.vm</param>
             </result>
         </action>
         <action name="i18n.ComputePrice" class="com.opensymphony.webwork.example.i18n.ComputePrice">
- 			<result name="success" type="velocity">
+            <result name="success" type="velocity">
                 <param name="location">shop.vm</param>
             </result>
         </action>
                 <param name="location">shop.jsp</param>
             </result>
         </action>
-<!--        <action name="i18n.Cart" class="com.opensymphony.webwork.example.i18n.Cart">-->
-<!--            <result name="success" type="dispatcher">-->
-<!--                <param name="location">cart.jsp</param>-->
-<!--            </result>-->
-<!--        </action>-->
+        <!--        <action name="i18n.Cart" class="com.opensymphony.webwork.example.i18n.Cart">-->
+        <!--            <result name="success" type="dispatcher">-->
+        <!--                <param name="location">cart.jsp</param>-->
+        <!--            </result>-->
+        <!--        </action>-->
         <action name="i18n.CDList" class="com.opensymphony.webwork.example.i18n.CDList">
             <result name="success" type="dispatcher">
                 <param name="location">cdlist.jsp</param>
             </result>
         </action>
         <action name="i18n.ComputePrice" class="com.opensymphony.webwork.example.i18n.ComputePrice">
- 			<result name="success" type="dispatcher">
+            <result name="success" type="dispatcher">
                 <param name="location">shop.jsp</param>
             </result>
         </action>

src/example/com/opensymphony/webwork/example/counter/SimpleCounter.java

  */
 package com.opensymphony.webwork.example.counter;
 
-import com.opensymphony.xwork.Action;
 import com.opensymphony.xwork.ActionSupport;
 
 
 /**
- *
- *
  * @author $Author$
  * @version $Revision$
  */

src/example/com/opensymphony/webwork/example/i18n/CDList.java

 import java.util.ArrayList;
 import java.util.List;
 import java.util.StringTokenizer;
-import java.util.Locale;
 
 /**
  * This code is an adaptation of the I18N example from the JavaWorld article by Govind Seshadri.

src/example/com/opensymphony/webwork/example/i18n/ComputePrice.java

 
 import java.io.IOException;
 import java.io.InputStream;
-import java.text.NumberFormat;
 import java.util.Properties;
 
 /**

src/example/com/opensymphony/webwork/example/i18n/Language.java

  */
 package com.opensymphony.webwork.example.i18n;
 
-import java.util.Locale;
-
 import com.opensymphony.xwork.ActionContext;
 
+import java.util.Locale;
+
 /**
  * This code is an adaptation of the I18N example from the JavaWorld article by Govind Seshadri.
  * http://www.javaworld.com/javaworld/jw-03-2000/jw-03-ssj-jsp_p.html

src/example/com/opensymphony/webwork/example/i18n/LanguageList.java

  */
 package com.opensymphony.webwork.example.i18n;
 
+import com.opensymphony.xwork.ActionSupport;
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Map;
 import java.util.Properties;
 
-import com.opensymphony.xwork.ActionSupport;
-
 /**
  * This code is an adaptation of the I18N example from the JavaWorld article by Govind Seshadri.
  * http://www.javaworld.com/javaworld/jw-03-2000/jw-03-ssj-jsp_p.html

src/example/com/opensymphony/webwork/example/i18n/Shop.java

  */
 package com.opensymphony.webwork.example.i18n;
 
-import java.util.Locale;
-import java.util.Map;
-
-import com.opensymphony.util.TextUtils;
 import com.opensymphony.xwork.ActionContext;
 import com.opensymphony.xwork.ActionSupport;
-import com.opensymphony.xwork.util.LocalizedTextUtil;
+
+import java.util.Locale;
+import java.util.Map;
 
 /**
  * This code is an adaptation of the I18N example from the JavaWorld article by Govind Seshadri.

src/java/com/opensymphony/webwork/ServletActionContext.java

 package com.opensymphony.webwork;
 
 import com.opensymphony.webwork.dispatcher.ServletDispatcher;
-
 import com.opensymphony.xwork.ActionContext;
 
-import java.util.Map;
-
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.jsp.PageContext;
+import java.util.Map;
 
 
 /**

src/java/com/opensymphony/webwork/config/Configuration.java

 package com.opensymphony.webwork.config;
 
 import com.opensymphony.xwork.ObjectFactory;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 

src/java/com/opensymphony/webwork/config/DefaultConfiguration.java

 package com.opensymphony.webwork.config;
 
 import com.opensymphony.xwork.util.LocalizedTextUtil;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
  * Default implementation of Configuration - creates and delegates to other configurations by using an internal
  * {@link DelegatingConfiguration}.
  *
- *
  * @author Rickard �berg
  * @author Jason Carreira
  * @author Bill Lynch (docs)

src/java/com/opensymphony/webwork/config/PropertiesConfiguration.java

 package com.opensymphony.webwork.config;
 
 import java.io.IOException;
-
 import java.net.URL;
-
 import java.util.Iterator;
 import java.util.Properties;
 

src/java/com/opensymphony/webwork/default.properties

 # Change this to reflect which path should be used for JSP control tag templates by default
 webwork.ui.theme=xhtml
 webwork.ui.templateDir=template
+#sets the default template type. Either vm or jsp
+webwork.ui.templateSuffix=vm
 
 ### Configuration reloading
 # This will cause the configuration to reload xwork.xml when it is changed

src/java/com/opensymphony/webwork/dispatcher/ApplicationMap.java

  */
 package com.opensymphony.webwork.dispatcher;
 
-import java.io.Serializable;
-
-import java.util.AbstractMap;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
 import javax.servlet.ServletContext;
+import java.io.Serializable;
+import java.util.*;
 
 
 /**
 
     /**
      * Creates a new map object given the servlet context.
+     *
      * @param ctx the servlet context
      */
     public ApplicationMap(ServletContext ctx) {
                 final String key = enumeration.nextElement().toString();
                 final Object value = context.getAttribute(key);
                 entries.add(new Map.Entry() {
-                        public boolean equals(Object obj) {
-                            Map.Entry entry = (Map.Entry) obj;
+                    public boolean equals(Object obj) {
+                        Map.Entry entry = (Map.Entry) obj;
 
-                            return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
-                        }
+                        return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
+                    }
 
-                        public int hashCode() {
-                            return ((key == null) ? 0 : key.hashCode()) ^ ((value == null) ? 0 : value.hashCode());
-                        }
+                    public int hashCode() {
+                        return ((key == null) ? 0 : key.hashCode()) ^ ((value == null) ? 0 : value.hashCode());
+                    }
 
-                        public Object getKey() {
-                            return key;
-                        }
+                    public Object getKey() {
+                        return key;
+                    }
 
-                        public Object getValue() {
-                            return value;
-                        }
+                    public Object getValue() {
+                        return value;
+                    }
 
-                        public Object setValue(Object obj) {
-                            context.setAttribute(key.toString(), obj);
+                    public Object setValue(Object obj) {
+                        context.setAttribute(key.toString(), obj);
 
-                            return value;
-                        }
-                    });
+                        return value;
+                    }
+                });
             }
 
             // Add servlet context init params
                 final String key = enumeration.nextElement().toString();
                 final Object value = context.getInitParameter(key);
                 entries.add(new Map.Entry() {
-                        public boolean equals(Object obj) {
-                            Map.Entry entry = (Map.Entry) obj;
+                    public boolean equals(Object obj) {
+                        Map.Entry entry = (Map.Entry) obj;
 
-                            return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
-                        }
+                        return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
+                    }
 
-                        public int hashCode() {
-                            return ((key == null) ? 0 : key.hashCode()) ^ ((value == null) ? 0 : value.hashCode());
-                        }
+                    public int hashCode() {
+                        return ((key == null) ? 0 : key.hashCode()) ^ ((value == null) ? 0 : value.hashCode());
+                    }
 
-                        public Object getKey() {
-                            return key;
-                        }
+                    public Object getKey() {
+                        return key;
+                    }
 
-                        public Object getValue() {
-                            return value;
-                        }
+                    public Object getValue() {
+                        return value;
+                    }
 
-                        public Object setValue(Object obj) {
-                            context.setAttribute(key.toString(), obj);
+                    public Object setValue(Object obj) {
+                        context.setAttribute(key.toString(), obj);
 
-                            return value;
-                        }
-                    });
+                        return value;
+                    }
+                });
             }
         }
 
     /**
      * Sets a servlet context attribute given a attribute name and value.
      *
-     * @param key the name of the attribute.
+     * @param key   the name of the attribute.
      * @param value the value to set.
      * @return the attribute that was just set.
      */

src/java/com/opensymphony/webwork/dispatcher/ChartResult.java

 package com.opensymphony.webwork.dispatcher;
 
 import com.opensymphony.webwork.ServletActionContext;
-
 import com.opensymphony.xwork.ActionInvocation;
 import com.opensymphony.xwork.Result;
-
 import org.jfree.chart.ChartUtilities;
 import org.jfree.chart.JFreeChart;
 
-import java.io.OutputStream;
-
 import javax.servlet.http.HttpServletResponse;
+import java.io.OutputStream;
 
 
 /**

src/java/com/opensymphony/webwork/dispatcher/CoolUriServletDispatcher.java

  */
 package com.opensymphony.webwork.dispatcher;
 
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
-
 import java.net.URLDecoder;
-
 import java.util.HashMap;
 import java.util.Map;
 import java.util.StringTokenizer;
 
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 
 /**
  * A custom servlet dispatcher that maps servlet paths to actions. The format is the following:
- *
- *
+ * <p/>
+ * <p/>
  * <ul><tt>http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2</tt></ul>
- *
+ * <p/>
  * You can have as many parameters you'd like to use. Alternatively the URL can be shortened to the following:
- *
+ * <p/>
  * <ul><tt>http://HOST/ACTION_NAME/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2</tt></ul>
- *
+ * <p/>
  * This is the same as:
- *
+ * <p/>
  * <ul><tt>http://HOST/ACTION_NAME/ACTION_NAME/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2</tt></ul>
- *
+ * <p/>
  * Suppose for example we would like to display some articles by id at using the following URL sheme:
- *
+ * <p/>
  * <ul><tt>http://HOST/article/ID</tt></ul>
- *
+ * <p/>
  * All we would have to do is to map the <tt>/article/*</tt> to this servlet and declare in WebWork an
  * action named <tt>article</tt>. This action would set its <tt>article</tt> parameter <tt>ID</tt>.
  *
      * {@link #serviceAction(HttpServletRequest, HttpServletResponse, String, String, Map, Map, Map, Map)}
      * method for action execution.
      *
-     * @param request the http servlet request.
+     * @param request  the http servlet request.
      * @param response the http servlet response.
      * @throws ServletException if an error occurs parsing the action name or parameters or if
-     *      an action occurs whene executing the action.
+     *                          an action occurs whene executing the action.
      */
     public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException {
         String actionName = request.getServletPath().substring(1, request.getServletPath().indexOf('/', 1));

src/java/com/opensymphony/webwork/dispatcher/FilterDispatcher.java

 package com.opensymphony.webwork.dispatcher;
 
 import com.opensymphony.webwork.WebWorkStatics;
-
 import com.opensymphony.xwork.ActionContext;
 import com.opensymphony.xwork.ActionProxy;
 import com.opensymphony.xwork.ActionProxyFactory;
 import com.opensymphony.xwork.interceptor.component.ComponentInterceptor;
 import com.opensymphony.xwork.interceptor.component.ComponentManager;
 import com.opensymphony.xwork.util.LocalizedTextUtil;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import javax.servlet.*;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
-
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
-import javax.servlet.*;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 
 /**
  * @author Jason Carreira
         HashMap newConfig = new HashMap();
 
         for (Iterator iterator = namespaceActionConfigs.entrySet().iterator();
-                iterator.hasNext();) {
+             iterator.hasNext();) {
             Map.Entry entry = (Map.Entry) iterator.next();
             String namespace = (String) entry.getKey();
             Map actionConfigs = (Map) entry.getValue();
 
             for (Iterator configIterator = actionConfigs.entrySet().iterator();
-                    configIterator.hasNext();) {
+                 configIterator.hasNext();) {
                 Map.Entry entry2 = (Map.Entry) configIterator.next();
                 String actionName = (String) entry2.getKey();
                 ActionConfig actionConfig = (ActionConfig) entry2.getValue();

src/java/com/opensymphony/webwork/dispatcher/HttpHeaderResult.java

 package com.opensymphony.webwork.dispatcher;
 
 import com.opensymphony.webwork.ServletActionContext;
-
 import com.opensymphony.xwork.ActionContext;
 import com.opensymphony.xwork.ActionInvocation;
 import com.opensymphony.xwork.Result;
 import com.opensymphony.xwork.util.OgnlValueStack;
 import com.opensymphony.xwork.util.TextParseUtil;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
-import javax.servlet.http.HttpServletResponse;
-
 
 /**
  * A custom Result type for evaluating HTTP headers against the ValueStack.
             OgnlValueStack stack = ActionContext.getContext().getValueStack();
 
             for (Iterator iterator = headers.entrySet().iterator();
-                    iterator.hasNext();) {
+                 iterator.hasNext();) {
                 Map.Entry entry = (Map.Entry) iterator.next();
                 String value = (String) entry.getValue();
                 String finalValue = parse ? TextParseUtil.translateVariables(value, stack) : value;

src/java/com/opensymphony/webwork/dispatcher/RequestMap.java

  */
 package com.opensymphony.webwork.dispatcher;
 
-import java.io.Serializable;
-
-import java.util.*;
-
 import javax.servlet.http.HttpServletRequest;
+import java.io.Serializable;
+import java.util.AbstractMap;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
 
 
 /**
                 final String key = enumeration.nextElement().toString();
                 final Object value = request.getAttribute(key);
                 entries.add(new Entry() {
-                        public boolean equals(Object obj) {
-                            Entry entry = (Entry) obj;
+                    public boolean equals(Object obj) {
+                        Entry entry = (Entry) obj;
 
-                            return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
-                        }
+                        return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
+                    }
 
-                        public int hashCode() {
-                            return ((key == null) ? 0 : key.hashCode()) ^ ((value == null) ? 0 : value.hashCode());
-                        }
+                    public int hashCode() {
+                        return ((key == null) ? 0 : key.hashCode()) ^ ((value == null) ? 0 : value.hashCode());
+                    }
 
-                        public Object getKey() {
-                            return key;
-                        }
+                    public Object getKey() {
+                        return key;
+                    }
 
-                        public Object getValue() {
-                            return value;
-                        }
+                    public Object getValue() {
+                        return value;
+                    }
 
-                        public Object setValue(Object obj) {
-                            request.setAttribute(key.toString(), obj);
+                    public Object setValue(Object obj) {
+                        request.setAttribute(key.toString(), obj);
 
-                            return value;
-                        }
-                    });
+                        return value;
+                    }
+                });
             }
         }
 

src/java/com/opensymphony/webwork/dispatcher/ServletDispatcher.java

 package com.opensymphony.webwork.dispatcher;
 
 import com.opensymphony.util.FileManager;
-
 import com.opensymphony.webwork.WebWorkStatics;
 import com.opensymphony.webwork.config.Configuration;
 import com.opensymphony.webwork.dispatcher.multipart.MultiPartRequest;
 import com.opensymphony.webwork.dispatcher.multipart.MultiPartRequestWrapper;
 import com.opensymphony.webwork.util.AttributeMap;
-import com.opensymphony.webwork.views.velocity.VelocityManager;
-
 import com.opensymphony.xwork.ActionContext;
 import com.opensymphony.xwork.ActionProxy;
 import com.opensymphony.xwork.ActionProxyFactory;
 import com.opensymphony.xwork.interceptor.component.ComponentInterceptor;
 import com.opensymphony.xwork.interceptor.component.ComponentManager;
 import com.opensymphony.xwork.util.LocalizedTextUtil;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import java.io.File;
-import java.io.IOException;
-
-import java.util.HashMap;
-import java.util.Map;
-
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
 
 
 /*
 
     // Path to save uploaded files to (this is configurable).
     String saveDir;
-    
+
     boolean paramsWorkaroundEnabled = false;
 
     //~ Methods ////////////////////////////////////////////////////////////////
     /**
      * Initalizes the servlet. Please read the {@link ServletDispatcher class documentation} for more
      * detail. <p>
-     * <p/>
-     * Note, the <a href="http://jakarta.apache.org/velocity/" target="_blank">Velocity</a> compontent is also
-     * initialized in this method - it is used in many of the WebWork2 JSP tags.
      *
      * @param config the ServletConfig object.
      * @throws ServletException if an error occurs during initialization.
     public void init(ServletConfig config) throws ServletException {
         super.init(config);
 
-        // initialize the VelocityEngine
-        VelocityManager.getInstance().init(config.getServletContext());
-
         LocalizedTextUtil.addDefaultResourceBundle("com/opensymphony/webwork/webwork-messages");
 
         //check for configuration reloading
         config.getServletContext().setAttribute("webwork.servlet", this);
         
         // test wether param-access workaround needs to be enabled
-        if(config.getServletContext().getServerInfo().indexOf("WebLogic") >= 0) {
+        if (config.getServletContext().getServerInfo().indexOf("WebLogic") >= 0) {
             log.info("WebLogic server detected. Enabling parameter access work-around.");
             paramsWorkaroundEnabled = true;
-        }
-        else {
+        } else {
             log.debug("Parameter access work-around disabled.");
         }
     }
      */
     public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException {
         try {
-            if(paramsWorkaroundEnabled)
+            if (paramsWorkaroundEnabled)
                 request.getParameter("foo"); // simply read any parameter (existing or not) to "prime" the request
-	   
+
             request = wrapRequest(request);
             serviceAction(request, response, getNameSpace(request), getActionName(request), getRequestMap(request), getParameterMap(request), getSessionMap(request), getApplicationMap());
         } catch (IOException e) {
      */
     public void serviceAction(HttpServletRequest request, HttpServletResponse response, String namespace, String actionName, Map requestMap, Map parameterMap, Map sessionMap, Map applicationMap) {
         HashMap extraContext = createContextMap(requestMap, parameterMap, sessionMap, applicationMap, request, response, getServletConfig());
-        extraContext.put(SERLVET_DISPATCHER, this);
+        extraContext.put(SERVLET_DISPATCHER, this);
 
         try {
             ActionProxy proxy = ActionProxyFactory.getFactory().createActionProxy(namespace, actionName, extraContext);

src/java/com/opensymphony/webwork/dispatcher/ServletDispatcherResult.java

 package com.opensymphony.webwork.dispatcher;
 
 import com.opensymphony.webwork.ServletActionContext;
-
 import com.opensymphony.xwork.ActionInvocation;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 
 /**
  * Includes or forwards a view. There are three possible ways the result can be executed: <ul>
- *
- *      <li>If we are in the scope of a JSP (a PageContext is available), PageContext's
- *          {@link PageContext#include(String) include} method is called.</li>
- *
- *      <li>If there is no PageContext and we're not in any sort of include (there is no
- *          "javax.servlet.include.servlet_path" in the request attributes), then a call to
- *          {@link RequestDispatcher#forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse) forward}
- *          is made.</li>
- *
- *      <li>Otherwise, {@link RequestDispatcher#include(javax.servlet.ServletRequest, javax.servlet.ServletResponse) include}
- *          is called.</li></ul>
- *
+ * <p/>
+ * <li>If we are in the scope of a JSP (a PageContext is available), PageContext's
+ * {@link PageContext#include(String) include} method is called.</li>
+ * <p/>
+ * <li>If there is no PageContext and we're not in any sort of include (there is no
+ * "javax.servlet.include.servlet_path" in the request attributes), then a call to
+ * {@link RequestDispatcher#forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse) forward}
+ * is made.</li>
+ * <p/>
+ * <li>Otherwise, {@link RequestDispatcher#include(javax.servlet.ServletRequest, javax.servlet.ServletResponse) include}
+ * is called.</li></ul>
+ * <p/>
  * This result follows the same rules from {@link WebWorkResultSupport}.
  *
- * @see javax.servlet.RequestDispatcher
  * @author Patrick Lightbody
+ * @see javax.servlet.RequestDispatcher
  */
 public class ServletDispatcherResult extends WebWorkResultSupport {
     //~ Static fields/initializers /////////////////////////////////////////////
      * dispatch fails a 404 error will be sent back in the http response.
      *
      * @param finalLocation the location to dispatch to.
-     * @param invocation the execution state of the action
+     * @param invocation    the execution state of the action
      * @throws Exception if an error occurs. If the dispatch fails the error will go back via the
-     *      HTTP request.
+     *                   HTTP request.
      */
     public void doExecute(String finalLocation, ActionInvocation invocation) throws Exception {
         if (log.isDebugEnabled()) {

src/java/com/opensymphony/webwork/dispatcher/ServletRedirectResult.java

 package com.opensymphony.webwork.dispatcher;
 
 import com.opensymphony.webwork.ServletActionContext;
-
 import com.opensymphony.xwork.ActionInvocation;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 
 /**
  * Calls the {@link HttpServletResponse#sendRedirect(String) sendRedirect} method to the location specified. <p>
- *
+ * <p/>
  * This result follows the same rules from {@link WebWorkResultSupport}.
  *
  * @author Patrick Lightbody
      * Sets whether or not to prepend the servlet context path to the redirected URL.
      *
      * @param prependServletContext <tt>true</tt> to prepend the location with the servlet context path,
-     *      <tt>false</tt> otherwise.
+     *                              <tt>false</tt> otherwise.
      */
     public void setPrependServletContext(boolean prependServletContext) {
         this.prependServletContext = prependServletContext;
      * Redirects to the location specified by calling {@link HttpServletResponse#sendRedirect(String)}.
      *
      * @param finalLocation the location to redirect to.
-     * @param invocation an encapsulation of the action execution state.
+     * @param invocation    an encapsulation of the action execution state.
      * @throws Exception if an error occurs when redirecting.
      */
     protected void doExecute(String finalLocation, ActionInvocation invocation) throws Exception {

src/java/com/opensymphony/webwork/dispatcher/SessionMap.java

  */
 package com.opensymphony.webwork.dispatcher;
 
-import java.io.Serializable;
-
-import java.util.*;
-
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
+import java.io.Serializable;
+import java.util.*;
 
 
 /**
                     final String key = enumeration.nextElement().toString();
                     final Object value = session.getAttribute(key);
                     entries.add(new Map.Entry() {
-                            public boolean equals(Object obj) {
-                                Map.Entry entry = (Map.Entry) obj;
+                        public boolean equals(Object obj) {
+                            Map.Entry entry = (Map.Entry) obj;
 
-                                return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
-                            }
+                            return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
+                        }
 
-                            public int hashCode() {
-                                return ((key == null) ? 0 : key.hashCode()) ^ ((value == null) ? 0 : value.hashCode());
-                            }
+                        public int hashCode() {
+                            return ((key == null) ? 0 : key.hashCode()) ^ ((value == null) ? 0 : value.hashCode());
+                        }
 
-                            public Object getKey() {
-                                return key;
-                            }
+                        public Object getKey() {
+                            return key;
+                        }
 
-                            public Object getValue() {
-                                return value;
-                            }
+                        public Object getValue() {
+                            return value;
+                        }
 
-                            public Object setValue(Object obj) {
-                                session.setAttribute(key.toString(), obj);
+                        public Object setValue(Object obj) {
+                            session.setAttribute(key.toString(), obj);
 
-                                return value;
-                            }
-                        });
+                            return value;
+                        }
+                    });
                 }
             }
         }

src/java/com/opensymphony/webwork/dispatcher/StreamResult.java

 package com.opensymphony.webwork.dispatcher;
 
-import java.io.InputStream;
-import java.io.OutputStream;
+import com.opensymphony.xwork.ActionInvocation;
 
 import javax.servlet.http.HttpServletResponse;
-
-import com.opensymphony.xwork.ActionInvocation;
+import java.io.InputStream;
+import java.io.OutputStream;
 
 /**
  * Implements an XWork Result that takes an InputStream object available from a chained
  * Action and redirects it to the browser.
- *
+ * <p/>
  * The following declaration must be added to the xwork.xml file after the <package>
  * element:
- *
+ * <p/>
  * <result-types>
- *    <result-type name="stream" class="StreamResult"/>
+ * <result-type name="stream" class="StreamResult"/>
  * </result-types>
- *
+ * <p/>
  * To use the stream result type add the following as part of the action declaration:
- *
+ * <p/>
  * <result name="success" type="stream">
- *    <param name="contentType">image/jpeg</param>
- *    <param name="inputName">imageStream</param>
- *    <param name="bufferSize">1024</param>
+ * <param name="contentType">image/jpeg</param>
+ * <param name="inputName">imageStream</param>
+ * <param name="bufferSize">1024</param>
  * </result>
- *
+ * <p/>
  * contentType = the stream mime-type as sent to the web browser
  * inputName = the name of the InputStream property from the chained action (default = "inputStream")
  * bufferSize = the size of the buffer to copy from input to output (defaul = 1024)
  */
 public class StreamResult extends WebWorkResultSupport {
 
-	protected String contentType = "text/plain";
-
-	protected String inputName = "inputStream";
-
-	protected int bufferSize = 1024;
-