You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by mr...@apache.org on 2004/12/30 07:56:22 UTC

svn commit: r123703 - in struts: core/trunk/src/share/org/apache/struts core/trunk/src/share/org/apache/struts/action core/trunk/src/share/org/apache/struts/actions core/trunk/src/share/org/apache/struts/chain/commands core/trunk/src/share/org/apache/struts/chain/commands/servlet core/trunk/src/share/org/apache/struts/taglib core/trunk/src/share/org/apache/struts/taglib/bean core/trunk/src/share/org/apache/struts/taglib/html core/trunk/src/share/org/apache/struts/taglib/logic core/trunk/src/share/org/apache/struts/taglib/nested core/trunk/src/share/org/apache/struts/taglib/tiles core/trunk/src/share/org/apache/struts/tiles core/trunk/src/share/org/apache/struts/util core/trunk/src/test/org/apache/struts/taglib core/trunk/src/test/org/apache/struts/tiles taglib taglib/branches taglib/tags taglib/trunk taglib/trunk/src taglib/trunk/src/java taglib/trunk/src/java/org taglib/trunk/src/java/org/apache taglib/trunk/src/java/org/apache/struts taglib/trunk/src/java/org/apache/struts/taglib taglib/trunk/src/java/org/apache/struts/taglib/bean taglib/trunk/src/java/org/apache/struts/taglib/html taglib/trunk/src/java/org/apache/struts/taglib/logic taglib/trunk/src/java/org/apache/struts/taglib/nested taglib/trunk/src/test taglib/trunk/src/test/org taglib/trunk/src/test/org/apache taglib/trunk/src/test/org/apache/struts taglib/trunk/src/test/org/apache/struts/taglib tiles tiles/branches tiles/tags tiles/trunk tiles/trunk/src tiles/trunk/src/java tiles/trunk/src/java/org tiles/trunk/src/java/org/apache tiles/trunk/src/java/org/apache/struts tiles/trunk/src/java/org/apache/struts/tiles tiles/trunk/src/java/org/apache/struts/tiles/commands tiles/trunk/src/java/org/apache/struts/tiles/taglib tiles/trunk/src/java/org/apache/struts/tiles/taglib/util tiles/trunk/src/test tiles/trunk/src/test/org tiles/trunk/src/test/org/apache tiles/trunk/src/test/org/apache/struts tiles/trunk/src/test/org/apache/struts/tiles

Author: mrdon
Date: Wed Dec 29 22:56:21 2004
New Revision: 123703

URL: http://svn.apache.org/viewcvs?view=rev&rev=123703
Log:
First cut at extracting Tiles and taglibs into their own subprojects.
I'm committing this now to solicit feedback and ensure it doesn't get
too far out-of-sync with Struts development.

Included in this commit:
 * Java files extraction of Tiles and taglib code from Struts core
 * New tiles and taglib subprojects containing migrated java code
 * Maven POM's for each subproject that compiles
 * Core now does not need Tiles or Taglib to compile
 * Tiles and taglib subprojects don't depend on each other at all
 * The tiles and taglib maven builds do require a Struts snapshot.  
   For now, since I don't know maven well, I built a core jar as 
   version 1.2.6 and added the jar to my local maven repository.
   In the future, I'd imagine the subprojects would need to depend 
   on some sort of Struts core snapshot.

What still needs to be done:
 * Migration of Struts examples...somehow
 * Migration of Tiles and Taglib documentation
 * Migration of Tiles and Taglib unit tests
 * Fix Core unit tests

Added:
   struts/taglib/
   struts/taglib/branches/
   struts/taglib/tags/
   struts/taglib/trunk/
   struts/taglib/trunk/project.xml
   struts/taglib/trunk/src/
   struts/taglib/trunk/src/java/
   struts/taglib/trunk/src/java/org/
   struts/taglib/trunk/src/java/org/apache/
   struts/taglib/trunk/src/java/org/apache/struts/
   struts/taglib/trunk/src/java/org/apache/struts/taglib/
   struts/taglib/trunk/src/java/org/apache/struts/taglib/LocalStrings.properties
      - copied unchanged from r122972, struts/core/trunk/src/share/org/apache/struts/taglib/LocalStrings.properties
   struts/taglib/trunk/src/java/org/apache/struts/taglib/LocalStrings_ja.properties
      - copied unchanged from r122972, struts/core/trunk/src/share/org/apache/struts/taglib/LocalStrings_ja.properties
   struts/taglib/trunk/src/java/org/apache/struts/taglib/TagUtils.java
      - copied, changed from r122972, struts/core/trunk/src/share/org/apache/struts/taglib/TagUtils.java
   struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/
      - copied from r122972, struts/core/trunk/src/share/org/apache/struts/taglib/bean/
   struts/taglib/trunk/src/java/org/apache/struts/taglib/html/
      - copied from r122972, struts/core/trunk/src/share/org/apache/struts/taglib/html/
   struts/taglib/trunk/src/java/org/apache/struts/taglib/logic/
      - copied from r122972, struts/core/trunk/src/share/org/apache/struts/taglib/logic/
   struts/taglib/trunk/src/java/org/apache/struts/taglib/nested/
      - copied from r122972, struts/core/trunk/src/share/org/apache/struts/taglib/nested/
   struts/taglib/trunk/src/test/
   struts/taglib/trunk/src/test/org/
   struts/taglib/trunk/src/test/org/apache/
   struts/taglib/trunk/src/test/org/apache/struts/
   struts/taglib/trunk/src/test/org/apache/struts/taglib/
      - copied from r123170, struts/core/trunk/src/test/org/apache/struts/taglib/
   struts/tiles/
   struts/tiles/branches/
   struts/tiles/tags/
   struts/tiles/trunk/
   struts/tiles/trunk/src/
   struts/tiles/trunk/src/java/
   struts/tiles/trunk/src/java/org/
   struts/tiles/trunk/src/java/org/apache/
   struts/tiles/trunk/src/java/org/apache/struts/
   struts/tiles/trunk/src/java/org/apache/struts/tiles/
      - copied from r122972, struts/core/trunk/src/share/org/apache/struts/tiles/
   struts/tiles/trunk/src/java/org/apache/struts/tiles/RedeployableActionServlet.java
      - copied unchanged from r122972, struts/core/trunk/src/share/org/apache/struts/actions/RedeployableActionServlet.java
   struts/tiles/trunk/src/java/org/apache/struts/tiles/commands/
   struts/tiles/trunk/src/java/org/apache/struts/tiles/commands/TilesPreProcessor.java
      - copied unchanged from r122972, struts/core/trunk/src/share/org/apache/struts/chain/commands/servlet/TilesPreProcessor.java
   struts/tiles/trunk/src/java/org/apache/struts/tiles/taglib/
      - copied from r122972, struts/core/trunk/src/share/org/apache/struts/taglib/tiles/
   struts/tiles/trunk/src/test/
   struts/tiles/trunk/src/test/org/
   struts/tiles/trunk/src/test/org/apache/
   struts/tiles/trunk/src/test/org/apache/struts/
   struts/tiles/trunk/src/test/org/apache/struts/tiles/
      - copied from r123170, struts/core/trunk/src/test/org/apache/struts/tiles/
Removed:
   struts/core/trunk/src/share/org/apache/struts/actions/RedeployableActionServlet.java
   struts/core/trunk/src/share/org/apache/struts/chain/commands/servlet/TilesPreProcessor.java
   struts/core/trunk/src/share/org/apache/struts/taglib/LocalStrings.properties
   struts/core/trunk/src/share/org/apache/struts/taglib/LocalStrings_ja.properties
   struts/core/trunk/src/share/org/apache/struts/taglib/TagUtils.java
   struts/core/trunk/src/share/org/apache/struts/taglib/bean/
   struts/core/trunk/src/share/org/apache/struts/taglib/html/
   struts/core/trunk/src/share/org/apache/struts/taglib/logic/
   struts/core/trunk/src/share/org/apache/struts/taglib/nested/
   struts/core/trunk/src/share/org/apache/struts/taglib/tiles/
   struts/core/trunk/src/share/org/apache/struts/tiles/
   struts/core/trunk/src/test/org/apache/struts/taglib/
   struts/core/trunk/src/test/org/apache/struts/tiles/
Modified:
   struts/core/trunk/src/share/org/apache/struts/Globals.java
   struts/core/trunk/src/share/org/apache/struts/action/RequestProcessor.java
   struts/core/trunk/src/share/org/apache/struts/chain/commands/AbstractPopulateActionForm.java
   struts/core/trunk/src/share/org/apache/struts/util/RequestUtils.java
   struts/core/trunk/src/share/org/apache/struts/util/ResponseUtils.java
   struts/core/trunk/src/share/org/apache/struts/util/TokenProcessor.java
   struts/taglib/trunk/src/java/org/apache/struts/taglib/html/FormTag.java
   struts/taglib/trunk/src/test/org/apache/struts/taglib/TestTagUtils.java
   struts/tiles/trunk/src/java/org/apache/struts/tiles/taglib/util/TagUtils.java

Modified: struts/core/trunk/src/share/org/apache/struts/Globals.java
Url: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/Globals.java?view=diff&rev=123703&p1=struts/core/trunk/src/share/org/apache/struts/Globals.java&r1=123702&p2=struts/core/trunk/src/share/org/apache/struts/Globals.java&r2=123703
==============================================================================
--- struts/core/trunk/src/share/org/apache/struts/Globals.java	(original)
+++ struts/core/trunk/src/share/org/apache/struts/Globals.java	Wed Dec 29 22:56:21 2004
@@ -199,5 +199,30 @@
     public static final String XHTML_KEY =
         "org.apache.struts.globals.XHTML";
 
+    /**
+     * The name of the taglib package.
+     */
+    public static final String TaglibPackage = "org.apache.struts.taglib.html";
+
+
+
+    /**
+     * The property under which a Cancel button press is reported.
+     */
+    public static final String CANCEL_PROPERTY = TaglibPackage + ".CANCEL";
+
+
+    /**
+     * The property under which a Cancel button press is reported, if the
+     * Cancel button is rendered as an image.
+     */
+    public static final String CANCEL_PROPERTY_X = TaglibPackage + ".CANCEL.x";
+
+
+    /**
+     * The property under which a transaction token is reported.
+     */
+    public static final String TOKEN_KEY = TaglibPackage + ".TOKEN";
+
 
 }

Modified: struts/core/trunk/src/share/org/apache/struts/action/RequestProcessor.java
Url: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/action/RequestProcessor.java?view=diff&rev=123703&p1=struts/core/trunk/src/share/org/apache/struts/action/RequestProcessor.java&r1=123702&p2=struts/core/trunk/src/share/org/apache/struts/action/RequestProcessor.java&r2=123703
==============================================================================
--- struts/core/trunk/src/share/org/apache/struts/action/RequestProcessor.java	(original)
+++ struts/core/trunk/src/share/org/apache/struts/action/RequestProcessor.java	Wed Dec 29 22:56:21 2004
@@ -37,7 +37,6 @@
 import org.apache.struts.config.ExceptionConfig;
 import org.apache.struts.config.ForwardConfig;
 import org.apache.struts.config.ModuleConfig;
-import org.apache.struts.taglib.html.Constants;
 import org.apache.struts.upload.MultipartRequestWrapper;
 import org.apache.struts.util.MessageResources;
 import org.apache.struts.util.RequestUtils;
@@ -797,8 +796,8 @@
                               request);
 
         // Set the cancellation request attribute if appropriate
-        if ((request.getParameter(Constants.CANCEL_PROPERTY) != null) ||
-            (request.getParameter(Constants.CANCEL_PROPERTY_X) != null)) {
+        if ((request.getParameter(Globals.CANCEL_PROPERTY) != null) ||
+            (request.getParameter(Globals.CANCEL_PROPERTY_X) != null)) {
                 
             request.setAttribute(Globals.CANCEL_KEY, Boolean.TRUE);
         }

Deleted: /struts/core/trunk/src/share/org/apache/struts/actions/RedeployableActionServlet.java
Url: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/actions/RedeployableActionServlet.java?view=auto&rev=123702
==============================================================================

Modified: struts/core/trunk/src/share/org/apache/struts/chain/commands/AbstractPopulateActionForm.java
Url: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/chain/commands/AbstractPopulateActionForm.java?view=diff&rev=123703&p1=struts/core/trunk/src/share/org/apache/struts/chain/commands/AbstractPopulateActionForm.java&r1=123702&p2=struts/core/trunk/src/share/org/apache/struts/chain/commands/AbstractPopulateActionForm.java&r2=123703
==============================================================================
--- struts/core/trunk/src/share/org/apache/struts/chain/commands/AbstractPopulateActionForm.java	(original)
+++ struts/core/trunk/src/share/org/apache/struts/chain/commands/AbstractPopulateActionForm.java	Wed Dec 29 22:56:21 2004
@@ -233,8 +233,8 @@
         Map paramValues = wcontext.getParamValues();
 
         // Set the cancellation attribute if appropriate
-        if ((paramValues.get(org.apache.struts.taglib.html.Constants.CANCEL_PROPERTY) != null) ||
-            (paramValues.get(org.apache.struts.taglib.html.Constants.CANCEL_PROPERTY_X) != null)) {
+        if ((paramValues.get(Globals.CANCEL_PROPERTY) != null) ||
+            (paramValues.get(Globals.CANCEL_PROPERTY_X) != null)) {
             context.put(getCancelKey(), Boolean.TRUE);
             wcontext.getRequestScope().put(Globals.CANCEL_KEY, Boolean.TRUE);
         } else {

Deleted: /struts/core/trunk/src/share/org/apache/struts/chain/commands/servlet/TilesPreProcessor.java
Url: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/chain/commands/servlet/TilesPreProcessor.java?view=auto&rev=123702
==============================================================================

Deleted: /struts/core/trunk/src/share/org/apache/struts/taglib/LocalStrings.properties
Url: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/taglib/LocalStrings.properties?view=auto&rev=123702
==============================================================================

Deleted: /struts/core/trunk/src/share/org/apache/struts/taglib/LocalStrings_ja.properties
Url: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/taglib/LocalStrings_ja.properties?view=auto&rev=123702
==============================================================================

Deleted: /struts/core/trunk/src/share/org/apache/struts/taglib/TagUtils.java
Url: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/taglib/TagUtils.java?view=auto&rev=123702
==============================================================================

Modified: struts/core/trunk/src/share/org/apache/struts/util/RequestUtils.java
Url: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/util/RequestUtils.java?view=diff&rev=123703&p1=struts/core/trunk/src/share/org/apache/struts/util/RequestUtils.java&r1=123702&p2=struts/core/trunk/src/share/org/apache/struts/util/RequestUtils.java&r2=123703
==============================================================================
--- struts/core/trunk/src/share/org/apache/struts/util/RequestUtils.java	(original)
+++ struts/core/trunk/src/share/org/apache/struts/util/RequestUtils.java	Wed Dec 29 22:56:21 2004
@@ -51,7 +51,6 @@
 import org.apache.struts.config.FormBeanConfig;
 import org.apache.struts.config.ForwardConfig;
 import org.apache.struts.config.ModuleConfig;
-import org.apache.struts.taglib.TagUtils;
 import org.apache.struts.upload.MultipartRequestHandler;
 import org.apache.struts.upload.MultipartRequestWrapper;
 
@@ -1130,570 +1129,4 @@
         return ModuleUtils.getInstance().getModulePrefixes(context);
 
     }
-
-
-    // ---------------------------------------- Deprecated in favor of TagUtils
-
-
-    /**
-     * <p>Compute a set of query parameters that will be dynamically added to
-     * a generated URL. The returned Map is keyed by parameter name, and the
-     * values are either null (no value specified), a String (single value
-     * specified), or a String[] array (multiple values specified). Parameter
-     * names correspond to the corresponding attributes of the
-     * <code>&lt;html:link&gt;</code> tag.  If no query parameters are
-     * identified, return <code>null</code>.</p>
-     *
-     * @param pageContext PageContext we are operating in
-
-     * @param paramId Single-value request parameter name (if any)
-     * @param paramName Bean containing single-value parameter value
-     * @param paramProperty Property (of bean named by <code>paramName</code>
-     *  containing single-value parameter value
-     * @param paramScope Scope containing bean named by
-     *  <code>paramName</code>
-     *
-     * @param name Bean containing multi-value parameters Map (if any)
-     * @param property Property (of bean named by <code>name</code>
-     *  containing multi-value parameters Map
-     * @param scope Scope containing bean named by
-     *  <code>name</code>
-     *
-     * @param transaction Should we add our transaction control token?
-     * @return Map of query parameters
-     * @exception JspException if we cannot look up the required beans
-     * @exception JspException if a class cast exception occurs on a
-     *  looked-up bean or property
-     * @deprecated This will be removed after Struts 1.2.
-     * Use {@link org.apache.struts.taglib.TagUtils#computeParameters(PageContext,String,String,String,String,String,String,String,boolean)} instead.
-     */
-    public static Map computeParameters(
-            PageContext pageContext,
-            String paramId,
-            String paramName,
-            String paramProperty,
-            String paramScope,
-            String name,
-            String property,
-            String scope,
-            boolean transaction)
-            throws JspException {
-        // :TODO: Remove after Struts 1.2
-
-        return TagUtils.getInstance().computeParameters(pageContext, paramId, paramName, paramProperty, paramScope,
-                                                        name, property, scope, transaction);
-
-    }
-
-
-    /**
-     * <p>Compute a hyperlink URL based on the <code>forward</code>,
-     * <code>href</code> or <code>page</code> parameter
-     * that is not null.</p>
-     *
-     * @param pageContext PageContext for the tag making this call
-     * @param forward Logical forward name for which to look up
-     *  the context-relative URI (if specified)
-     * @param href URL to be utilized unmodified (if specified)
-     * @param page Module-relative page for which a URL should
-     *  be created (if specified)
-     * @param params Map of parameters to be dynamically included (if any)
-     * @param anchor Anchor to be dynamically included (if any)
-     * @param redirect Is this URL for a <code>response.sendRedirect()</code>?
-
-     * @return URL with session identifier
-     * @exception MalformedURLException if a URL cannot be created
-     *  for the specified parameters
-     * @deprecated This will be removed after Struts 1.2
-     * Use {@link RequestUtils#computeURL(PageContext, String, String, String, String, Map, String, boolean)} instead.
-     */
-    public static String computeURL(
-            PageContext pageContext,
-            String forward,
-            String href,
-            String page,
-            Map params,
-            String anchor,
-            boolean redirect)
-            throws MalformedURLException {
-        // :TODO: Remove after Struts 1.2
-
-        return (TagUtils.getInstance().computeURLWithCharEncoding(
-                pageContext, forward, href, page, null, null, params, anchor, redirect, false));
-    }
-
-
-    /**
-     * <p>Compute a hyperlink URL based on the <code>forward</code>,
-     * <code>href</code>, <code>action</code> or <code>page</code> parameter
-     * that is not null.
-     * The returned URL will have already been passed to
-     * <code>response.encodeURL()</code> for adding a session identifier.</p>
-     *
-     * @param pageContext PageContext for the tag making this call
-     * @param forward Logical forward name for which to look up
-     *  the context-relative URI (if specified)
-     * @param href URL to be utilized unmodified (if specified)
-     * @param page Module-relative page for which a URL should
-     *  be created (if specified)
-     * @param action Logical action name for which to look up
-     *  the context-relative URI (if specified)
-     * @param params Map of parameters to be dynamically included (if any)
-     * @param anchor Anchor to be dynamically included (if any)
-     * @param redirect Is this URL for a <code>response.sendRedirect()</code>?
-
-     * @return URL with session identifier
-     * @exception MalformedURLException if a URL cannot be created
-     *  for the specified parameters
-     * @deprecated This will be removed after Struts 1.2.
-     * Use {@link org.apache.struts.taglib.TagUtils#computeURL(PageContext,String,String,String,String,String,Map,String,	boolean)} instead.
-     */
-    public static String computeURL(
-            PageContext pageContext,
-            String forward,
-            String href,
-            String page,
-            String action,
-            Map params,
-            String anchor,
-            boolean redirect)
-            throws MalformedURLException {
-        // :TODO: Remove after Struts 1.2
-
-        return TagUtils.getInstance().computeURL(
-                pageContext,
-                forward,
-                href,
-                page,
-                action,
-                null,
-                params,
-                anchor,
-                redirect);
-    }
-
-
-    /**
-     * <p>Compute a hyperlink URL based on the <code>forward</code>,
-     * <code>href</code>, <code>action</code> or <code>page</code> parameter
-     * that is not null.
-     * The returned URL will have already been passed to
-     * <code>response.encodeURL()</code> for adding a session identifier.
-     * </p>
-     *
-     * @param pageContext PageContext for the tag making this call
-     * @param forward Logical forward name for which to look up
-     *  the context-relative URI (if specified)
-     * @param href URL to be utilized unmodified (if specified)
-     * @param page Module-relative page for which a URL should
-     *  be created (if specified)
-     * @param action Logical action name for which to look up
-     *  the context-relative URI (if specified)
-     * @param params Map of parameters to be dynamically included (if any)
-     * @param anchor Anchor to be dynamically included (if any)
-     * @param redirect Is this URL for a <code>response.sendRedirect()</code>?
-     * @param encodeSeparator This is only checked if redirect is set to false (never
-     * encoded for a redirect).  If true, query string parameter separators are encoded
-     * as &gt;amp;, else &amp; is used.
-
-     * @return URL with session identifier
-     * @exception MalformedURLException if a URL cannot be created
-     *  for the specified parameters
-     * @deprecated This will be removed after Struts 1.2.
-     * Use {@link org.apache.struts.taglib.TagUtils#computeURL(PageContext,String,String,String,String,String,Map,String,boolean,boolean)} instead.
-     */
-    public static String computeURL(
-            PageContext pageContext,
-            String forward,
-            String href,
-            String page,
-            String action,
-            Map params,
-            String anchor,
-            boolean redirect,
-            boolean encodeSeparator)
-            throws MalformedURLException {
-        // :TODO: Remove after Struts 1.2
-
-        return (TagUtils.getInstance().computeURL(
-                pageContext,
-                forward,
-                href,
-                page,
-                action,
-                null,
-                params,
-                anchor,
-                redirect,
-                encodeSeparator));
-    }
-
-
-    /**
-     * <p>Return the form action converted into an action mapping path.  The
-     * value of the <code>action</code> property is manipulated as follows in
-     * computing the name of the requested mapping:</p>
-     * <ul>
-     * <li>Any filename extension is removed (on the theory that extension
-     *     mapping is being used to select the controller servlet).</li>
-     * <li>If the resulting value does not start with a slash, then a
-     *     slash is prepended.</li>
-     * </ul>
-     * @deprecated  This will be removed after Struts 1.2.
-     * Use {@link org.apache.struts.taglib.TagUtils#getActionMappingName(String)} instead.
-     */
-    public static String getActionMappingName(String action) {
-        // :TODO: Remove after Struts 1.2
-
-        return TagUtils.getInstance().getActionMappingName(action);
-
-    }
-
-
-    /**
-     * <p>Return the form action converted into a server-relative URL.</p>
-     * @deprecated This will be removed after Struts 1.2.
-     * Use {@link org.apache.struts.taglib.TagUtils#getActionMappingURL(String,PageContext)} instead.
-     */
-    public static String getActionMappingURL(
-            String action,
-            PageContext pageContext) {
-        // :TODO: Remove after Struts 1.2
-
-        return TagUtils.getInstance().getActionMappingURL(action, pageContext);
-
-    }
-
-
-    /**
-     * <p>Locate and return the specified bean, from an optionally specified
-     * scope, in the specified page context. If no such bean is found,
-     * return <code>null</code> instead. If an exception is thrown, it will
-     * have already been saved via a call to <code>saveException</code>.</p>
-     *
-     * @param pageContext Page context to be searched
-     * @param name Name of the bean to be retrieved
-     * @param scopeName Scope to be searched (page, request, session, application)
-     *  or <code>null</code> to use <code>findAttribute()</code> instead
-     *
-     * @return JavaBean in the specified page context
-     * @exception JspException if an invalid scope name
-     *  is requested
-     * @deprecated This will be removed after Struts 1.2.
-     * Use {@link org.apache.struts.taglib.TagUtils#lookup(PageContext,String,String)} instead.
-     */
-    public static Object lookup(PageContext pageContext, String name, String scopeName)
-            throws JspException {
-        // :TODO: Remove after Struts 1.2
-
-        return TagUtils.getInstance().lookup(pageContext, name, scopeName);
-
-    }
-
-
-    /**
-     * <p>Converts the scope name into its corresponding PageContext constant value.</p>
-     *
-     * @param scopeName Can be "page", "request", "session", or "application" in any
-     * case
-     *
-     * @return The constant representing the scope (ie. PageContext.REQUEST_SCOPE).
-     * @throws JspException if the scopeName is not a valid name.
-     * @since Struts 1.1
-     * @deprecated This will be removed after Struts 1.2.
-     * Use {@link org.apache.struts.taglib.TagUtils#getScope(String)} instead.
-
-     */
-    public static int getScope(String scopeName) throws JspException {
-        // :TODO: Remove after Struts 1.2
-
-        return TagUtils.getInstance().getScope(scopeName);
-
-    }
-
-
-    /**
-     * <p>Locate and return the specified property of the specified bean, from
-     * an optionally specified scope, in the specified page context. If an
-     * exception is thrown, it will have already been saved via a call to
-     * <code>saveException</code>.</p>
-     *
-     * @param pageContext Page context to be searched
-     * @param name Name of the bean to be retrieved
-     * @param property Name of the property to be retrieved, or
-     *  <code>null</code> to retrieve the bean itself
-     * @param scope Scope to be searched (page, request, session, application)
-     *  or <code>null</code> to use <code>findAttribute()</code> instead
-     *
-     * @return property of specified JavaBean
-     * @exception JspException if an invalid scope name
-     *  is requested
-     * @exception JspException if the specified bean is not found
-     * @exception JspException if accessing this property causes an
-     *  IllegalAccessException, IllegalArgumentException,
-     *  InvocationTargetException, or NoSuchMethodException
-     * @deprecated This will be removed after Struts 1.2.
-     * Use {@link org.apache.struts.taglib.TagUtils#lookup(PageContext,String,String,String)} instead.
-
-     */
-    public static Object lookup(
-            PageContext pageContext,
-            String name,
-            String property,
-            String scope)
-            throws JspException {
-        // :TODO: Remove after Struts 1.2
-
-        return TagUtils.getInstance().lookup(pageContext, name, property, scope);
-
-    }
-
-
-    /**
-     * <p>Look up and return current user locale, based on the specified parameters.</p>
-     *
-     * @param pageContext The PageContext associated with this request
-     * @param locale Name of the session attribute for our user's Locale.  If this is
-     * <code>null</code>, the default locale key is used for the lookup.
-     *
-     * @return current user locale
-     * @deprecated This will be removed after Struts 1.2.
-     * Use {@link org.apache.struts.taglib.TagUtils#getUserLocale(PageContext,String)} instead.
-     */
-    public static Locale retrieveUserLocale(PageContext pageContext, String locale) {
-        // :TODO: Remove after Struts 1.2
-
-        return TagUtils.getInstance().getUserLocale(pageContext, locale);
-
-    }
-
-
-    /**
-     * <p>Look up and return a message string, based on the specified parameters.</p>
-     *
-     * @param pageContext The PageContext associated with this request
-     * @param bundle Name of the servlet context attribute for our
-     *  message resources bundle
-     * @param locale Name of the session attribute for our user's Locale
-     * @param key Message key to be looked up and returned
-     *
-     * @return message string
-     * @exception JspException if a lookup error occurs (will have been
-     *  saved in the request already)
-     * @deprecated Use {@link org.apache.struts.taglib.TagUtils#message(PageContext,String,String,String)} instead.
-     * This will be removed after Struts 1.2.
-     */
-    public static String message(
-            PageContext pageContext,
-            String bundle,
-            String locale,
-            String key)
-            throws JspException {
-        // :TODO: Remove afer Struts 1.2
-
-        return TagUtils.getInstance().message(pageContext, bundle, locale, key);
-
-    }
-
-
-    /**
-     * Look up and return a message string, based on the specified parameters.
-     *
-     * @param pageContext The PageContext associated with this request
-     * @param bundle Name of the servlet context attribute for our
-     *  message resources bundle
-     * @param locale Name of the session attribute for our user's Locale
-     * @param key Message key to be looked up and returned
-     * @param args Replacement parameters for this message
-     * @return message string
-     * @exception JspException if a lookup error occurs (will have been
-     *  saved in the request already)
-     * @deprecated Use {@link org.apache.struts.taglib.TagUtils#message(PageContext,String,String,String,Object[])} instead.
-     * This will be removed after Struts 1.2.
-     */
-    public static String message(
-            PageContext pageContext,
-            String bundle,
-            String locale,
-            String key,
-            Object args[])
-            throws JspException {
-        // :TODO: Remove afer Struts 1.2
-
-        return TagUtils.getInstance().message(
-                pageContext,
-                bundle,
-                locale,
-                key,
-                args);
-    }
-
-
-    /**
-     * <p>Return true if a message string for the specified message key
-     * is present for the specified Locale.</p>
-     *
-     * @param pageContext The PageContext associated with this request
-     * @param bundle Name of the servlet context attribute for our
-     *  message resources bundle
-     * @param locale Name of the session attribute for our user's Locale
-     * @param key Message key to be looked up and returned
-     *
-     * @return true if a message string for message key exists
-     * @exception JspException if a lookup error occurs (will have been
-     *  saved in the request already)
-     * @deprecated Use {@link org.apache.struts.taglib.TagUtils#present(PageContext ,String,String,String)} instead.
-     * This will be removed after Struts 1.2.
-     */
-    public static boolean present(
-            PageContext pageContext,
-            String bundle,
-            String locale,
-            String key)
-            throws JspException {
-        // :TODO: Remove after Struts 1.2
-
-        return TagUtils.getInstance().present(pageContext, bundle, locale, key);
-
-    }
-
-
-    /**
-     * <p>Return the context-relative URL that corresponds to the specified
-     * <code>page</code> attribute value, calculated based on the
-     * <code>pagePattern</code> property of the current module's
-     * {@link ModuleConfig}.</p>
-     *
-     * @param request The servlet request we are processing
-     * @param page The module-relative URL to be substituted in
-     *  to the <code>pagePattern</code> pattern for the current module
-     *  (<strong>MUST</strong> start with a slash)
-
-     * @return context-relative URL
-     * @since Struts 1.1
-     * @deprecated Use {@link org.apache.struts.taglib.TagUtils#pageURL(HttpServletRequest request, String page, ModuleConfig moduleConfig)} instead.
-     * This will be removed after Struts 1.2.
-     */
-    public static String pageURL(HttpServletRequest request, String page) {
-    	//load the current moduleConfig
-		ModuleConfig moduleConfig = ModuleUtils.getInstance().getModuleConfig(request);
-		
-        return TagUtils.getInstance().pageURL(request, page, moduleConfig);
-        //:TODO: Remove after Struts 1.2
-
-    }
-
-
-    /**
-     * <p>Save the specified exception as a request attribute for later use.</p>
-     *
-     * @param pageContext The PageContext for the current page
-     * @param exception The exception to be saved
-     *
-     * @deprecated Use {@link org.apache.struts.taglib.TagUtils#saveException(PageContext,Throwable)} instead.
-     * This will be removed after Struts 1.2.
-     */
-    public static void saveException(PageContext pageContext, Throwable exception) {
-
-        TagUtils.getInstance().saveException(pageContext, exception);
-        // :TODO: Remove after Struts 1.2
-
-    }
-
-
-    /**
-     * <p>Return the <code>ModuleConfig</code> object if it exists, null if otherwise.</p>
-     *
-     * @param pageContext The page context.
-     *
-     * @return the ModuleConfig object
-     * @since Struts 1.1
-     * @deprecated Use {@link org.apache.struts.taglib.TagUtils#getModuleConfig(PageContext)} instead.
-     * This will be removed after Struts 1.2.
-     */
-    public static ModuleConfig getModuleConfig(PageContext pageContext) {
-        // :TODO: Remove after Struts 1.2
-
-        return TagUtils.getInstance().getModuleConfig(pageContext);
-
-    }
-
-
-    /**
-     * <p>Retrieves the value from request scope and if it isn't already an
-     * <code>ActionMessages</code> some classes are converted to one.</p>
-     *
-     * @param pageContext   The PageContext for the current page
-     * @param paramName     Key for parameter value
-     *
-     * @return ActionErros in page context.
-     * @throws JspException
-     * @deprecated Use {@link org.apache.struts.taglib.TagUtils#getActionMessages(PageContext,String)} instead.
-     * This will be removed after Struts 1.2.
-     */
-    public static ActionMessages getActionMessages(PageContext pageContext, String paramName)
-            throws JspException {
-        // :TODO: Remove after Struts 1.2
-
-        return TagUtils.getInstance().getActionMessages(pageContext, paramName);
-    }
-
-
-    /**
-     * <p>Retrieves the value from request scope and if it isn't already an
-     *  <code>ErrorMessages</code> some classes are converted to one.</p>
-     *
-     * @param pageContext   The PageContext for the current page
-     * @param paramName     Key for parameter value
-     *
-     *
-     * @return ActionErrors from request scope
-     * @exception JspException
-     * @deprecated Use {@link org.apache.struts.taglib.TagUtils#getActionErrors(PageContext,String)} instead.
-     * This will be removed after Struts 1.2.
-     */
-    public static ActionErrors getActionErrors(PageContext pageContext, String paramName)
-            throws JspException {
-        // :TODO: Remove after Struts 1.2
-
-        return TagUtils.getInstance().getActionErrors(pageContext, paramName);
-    }
-
-
-    /**
-     * <p>Use the new <code>URLEncoder.encode</code> method from Java 1.4 if available, else
-     * use the old deprecated version. This method uses reflection to find the appropriate
-     * method; if the reflection operations throw exceptions, this will return the url
-     * encoded with the old <code>URLEncoder.encode</code> method.
-     * @return String - the encoded url.
-     * @deprecated Use {@link org.apache.struts.taglib.TagUtils#encodeURL(String)} instead.
-     * This will be removed after Struts 1.2.
-     */
-    public static String encodeURL(String url) {
-        // :TODO: Remove after Struts 1.2
-
-        return TagUtils.getInstance().encodeURL(url);
-
-    }
-
-
-    /**
-     * <p>Returns true if the custom tags are in XHTML mode.</p>
-     *
-     * @since Struts 1.1
-     * @deprecated Use {@link org.apache.struts.taglib.TagUtils#isXhtml(PageContext)} instead.
-     * This will be removed after Struts 1.2.
-     */
-    public static boolean isXhtml(PageContext pageContext) {
-        // :TODO: Remove after Struts 1.2
-
-        String xhtml =
-                (String) pageContext.getAttribute(
-                        Globals.XHTML_KEY,
-                        PageContext.PAGE_SCOPE);
-
-        return "true".equalsIgnoreCase(xhtml);
-
-    }
-
 }

Modified: struts/core/trunk/src/share/org/apache/struts/util/ResponseUtils.java
Url: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/util/ResponseUtils.java?view=diff&rev=123703&p1=struts/core/trunk/src/share/org/apache/struts/util/ResponseUtils.java&r1=123702&p2=struts/core/trunk/src/share/org/apache/struts/util/ResponseUtils.java&r2=123703
==============================================================================
--- struts/core/trunk/src/share/org/apache/struts/util/ResponseUtils.java	(original)
+++ struts/core/trunk/src/share/org/apache/struts/util/ResponseUtils.java	Wed Dec 29 22:56:21 2004
@@ -18,23 +18,25 @@
 
 package org.apache.struts.util;
 
-import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.PageContext;
-
-import org.apache.struts.taglib.TagUtils;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URLEncoder;
+
+import java.io.IOException;
+import org.apache.struts.Globals;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.logging.Log;
 
 /**
  * General purpose utility methods related to generating a servlet response
  * in the Struts controller framework.
  *
  * @version $Rev$ $Date$
- * @deprecated Use the corresponding TagUtils methods instead.  
- * This class will be removed after Struts 1.2.
  */
 public class ResponseUtils {
 
-
-    // ------------------------------------------------------- Static Variables
+   // ------------------------------------------------------- Static Variables
 
 
     /**
@@ -44,60 +46,133 @@
         MessageResources.getMessageResources
         ("org.apache.struts.util.LocalStrings");
 
+    /**
+     * Java 1.4 encode method to use instead of deprecated 1.3 version.
+     */
+    private static Method encode = null;
+
 
+    /**
+     * Commons logging instance.
+     */
+    private static final Log log = LogFactory.getLog(ResponseUtils.class);
 
-    // --------------------------------------------------------- Public Methods
 
 
     /**
-     * Filter the specified string for characters that are senstive to
-     * HTML interpreters, returning the string with these characters replaced
-     * by the corresponding character entities.
-     *
-     * @param value The string to be filtered and returned
-     * @deprecated
+     * Initialize the encode variable with the
+     * Java 1.4 method if available.
      */
-    public static String filter(String value) {
-        return TagUtils.getInstance().filter(value);
+    static {
+
+        try {
+            // get version of encode method with two String args
+            Class[] args = new Class[]{String.class, String.class};
+            encode = URLEncoder.class.getMethod("encode", args);
+        } catch (NoSuchMethodException e) {
+            log.debug("Could not find Java 1.4 encode method.  Using deprecated version.", e);
+        }
     }
 
 
+
+     // --------------------------------------------------------- Public Methods
+
+
     /**
-     * Write the specified text as the response to the writer associated with
-     * this page.  <strong>WARNING</strong> - If you are writing body content
-     * from the <code>doAfterBody()</code> method of a custom tag class that
-     * implements <code>BodyTag</code>, you should be calling
-     * <code>writePrevious()</code> instead.
-     *
-     * @param pageContext The PageContext object for this page
-     * @param text The text to be written
+     * Filter the specified string for characters that are senstive to
+     * HTML interpreters, returning the string with these characters replaced
+     * by the corresponding character entities.
      *
-     * @exception JspException if an input/output error occurs (already saved)
+     * @param value The string to be filtered and returned
      * @deprecated
      */
-    public static void write(PageContext pageContext, String text)
-        throws JspException {
+    public static String filter(String value) {
 
-        TagUtils.getInstance().write(pageContext, text);
+        if (value == null || value.length() == 0) {
+            return value;
+        }
+
+        StringBuffer result = null;
+        String filtered = null;
+        for (int i = 0; i < value.length(); i++) {
+            filtered = null;
+            switch (value.charAt(i)) {
+                case '<':
+                    filtered = "&lt;";
+                    break;
+                case '>':
+                    filtered = "&gt;";
+                    break;
+                case '&':
+                    filtered = "&amp;";
+                    break;
+                case '"':
+                    filtered = "&quot;";
+                    break;
+                case '\'':
+                    filtered = "&#39;";
+                    break;
+            }
+
+            if (result == null) {
+                if (filtered != null) {
+                    result = new StringBuffer(value.length() + 50);
+                    if (i > 0) {
+                        result.append(value.substring(0, i));
+                    }
+                    result.append(filtered);
+                }
+            } else {
+                if (filtered == null) {
+                    result.append(value.charAt(i));
+                } else {
+                    result.append(filtered);
+                }
+            }
+        }
 
+        return result == null ? value : result.toString();
     }
-
+	
+    
+    /**
+	 * URLencodes a string assuming the character encoding is UTF-8.
+	 *
+	 * @param url
+	 * @return String The encoded url in UTF-8
+	 */
+	public static String encodeURL(String url) {
+		return encodeURL(url, "UTF-8");
+	}
 
     /**
-     * Write the specified text as the response to the writer associated with
-     * the body content for the tag within which we are currently nested.
-     *
-     * @param pageContext The PageContext object for this page
-     * @param text The text to be written
-     *
-     * @exception JspException if an input/output error occurs (already saved)
-     * @deprecated
+     * Use the new URLEncoder.encode() method from Java 1.4 if available, else
+     * use the old deprecated version.  This method uses reflection to find the
+     * appropriate method; if the reflection operations throw exceptions, this
+     * will return the url encoded with the old URLEncoder.encode() method.
+     * @param enc The character encoding the urlencode is performed on.
+     * @return String The encoded url.
      */
-    public static void writePrevious(PageContext pageContext, String text)
-        throws JspException {
+    public static String encodeURL(String url, String enc) {
+        try {
 
-        TagUtils.getInstance().writePrevious(pageContext, text);
+			if(enc==null || enc.length()==0){
+				enc = "UTF-8";
+			}
+
+            // encode url with new 1.4 method and UTF-8 encoding
+            if (encode != null) {
+                return (String) encode.invoke(null, new Object[]{url,  enc});
+            }
+
+        } catch (IllegalAccessException e) {
+            log.debug("Could not find Java 1.4 encode method.  Using deprecated version.", e);
+        } catch (InvocationTargetException e) {
+            log.debug("Could not find Java 1.4 encode method. Using deprecated version.", e);
+        }
 
+        return URLEncoder.encode(url);
     }
 
 

Modified: struts/core/trunk/src/share/org/apache/struts/util/TokenProcessor.java
Url: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/util/TokenProcessor.java?view=diff&rev=123703&p1=struts/core/trunk/src/share/org/apache/struts/util/TokenProcessor.java&r1=123702&p2=struts/core/trunk/src/share/org/apache/struts/util/TokenProcessor.java&r2=123703
==============================================================================
--- struts/core/trunk/src/share/org/apache/struts/util/TokenProcessor.java	(original)
+++ struts/core/trunk/src/share/org/apache/struts/util/TokenProcessor.java	Wed Dec 29 22:56:21 2004
@@ -25,7 +25,6 @@
 import javax.servlet.http.HttpSession;
 
 import org.apache.struts.Globals;
-import org.apache.struts.taglib.html.Constants;
 
 /**
  * TokenProcessor is responsible for handling all token related functionality.  The 
@@ -119,7 +118,7 @@
         }
 
         // Retrieve the transaction token included in this request
-        String token = request.getParameter(Constants.TOKEN_KEY);
+        String token = request.getParameter(Globals.TOKEN_KEY);
         if (token == null) {
             return false;
         }

Added: struts/taglib/trunk/project.xml
Url: http://svn.apache.org/viewcvs/struts/taglib/trunk/project.xml?view=auto&rev=123703
==============================================================================
--- (empty file)
+++ struts/taglib/trunk/project.xml	Wed Dec 29 22:56:21 2004
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <pomVersion>3</pomVersion>
+  <id>struts-taglib</id>
+  <name>Struts Taglibs</name>
+  <currentVersion>1.0-SNAPSHOT</currentVersion>
+  
+  <organization>
+    <name />
+    <url>http://struts.apache.org/taglib/</url>
+    <logo />
+  </organization>
+  <logo>http://struts.apache.org/struts/images/struts.gif</logo>
+  <inceptionYear>2003</inceptionYear>
+  <package>org.apache.struts.taglib</package>
+  <packageGroups>
+    <packageGroup>
+      <title>Struts Taglibs</title>
+      <packages>org.apache.struts.taglib</packages>
+    </packageGroup>
+  </packageGroups>
+
+  <shortDescription>Scriptable Struts Actions Using BSF</shortDescription>
+
+  <!--  
+  <gumpRepositoryId></gumpRepositoryId>
+  -->
+
+  <description>
+    This project allows Struts Actions to be written in the scripting language of one's choice rather than as Java classes. It uses the Beans Scripting Framework to allow scripts to be written in any language BSF supports like Perl, Python, Ruby, JavaScript, BeanShell, and I believe even VBScript.
+  </description>
+    
+  <url>http://struts.apache.org/taglib</url>
+  <repository>
+    <connection>scm|svn|http|//svn.apache.org/repos/asf/struts/taglib/trunk</connection>
+    <developerConnection>scm|svn|https|//svn.apache.org/repos/asf/struts/taglib/trunk</developerConnection>
+    <url>http://svn.apache.org/repos/asf/struts/taglib/trunk</url>
+  </repository>
+  <versions>
+    <!--
+    <version>
+      <id>rel_0_5</id>
+      <name>rel_0_5</name>
+      <tag>rel_0_5</tag>
+    </version>
+    -->
+  </versions>
+<!--
+  <branches>
+  	<branch>
+  	  <tag></tag>
+  	</branch>
+  </branches>
+-->  
+  <mailingLists>
+    <mailingList>
+      <name>Struts User List</name>
+      <subscribe>user-subscribe@struts.apache.org</subscribe>
+      <unsubscribe>user-unsubscribe@struts.apache.org</unsubscribe>
+      <archive>http://mail-archives.apache.org/eyebrowse/SummarizeList?listId=42</archive>
+    </mailingList>
+    <mailingList>
+      <name>Struts Developer List</name>
+      <subscribe>dev-subscribe@struts.apache.org</subscribe>
+      <unsubscribe>dev-unsubscribe@struts.apache.org</unsubscribe>
+      <archive>http://mail-archives.apache.org/eyebrowse/SummarizeList?listId=41</archive>
+    </mailingList>
+  </mailingLists>
+  <developers>
+	<developer>
+		<name>Don Brown</name>
+		<id>mrdon</id>
+        <email>mrdon at apache.org</email>
+		<organization/>
+	</developer>
+     <developer>
+        <name>Joe Germuska</name>
+        <email>germuska at apache.org</email>
+		<id>germuska</id>
+        <organization></organization>
+     </developer>
+</developers>
+
+<!--   <contributors /> -->
+  <dependencies>
+    <dependency>
+      <id>servletapi</id>
+      <version>2.3</version>
+    </dependency>
+    <dependency>
+      <id>struts</id>
+      <version>1.2.6</version>
+    </dependency>
+    <dependency>
+      <id>commons-logging</id>
+      <version>1.0.3</version>
+    </dependency>
+    <dependency>
+      <id>commons-beanutils</id>
+      <version>1.7.0</version>
+    </dependency>
+    <dependency>
+      <id>commons-digester</id>
+      <version>1.6</version>
+    </dependency>
+   <dependency>
+      <id>commons-validator</id>
+      <version>1.1.3</version>
+    </dependency>
+    <dependency>
+      <id>oro</id>
+      <version>2.0.7</version>
+    </dependency>
+  </dependencies>
+  
+  <build>
+    <nagEmailAddress/>
+    <sourceDirectory>src/java</sourceDirectory>
+
+<!--
+    <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
+    <integrationUnitTestSourceDirectory/>
+    <aspectSourceDirectory/>
+
+    <resources>      
+      <resource>      
+        <directory></directory>
+        <includes>
+          <include></include>
+        </includes>
+      </resource>
+    </resources>
+
+    <unitTest>
+      <includes>
+        <include>**/Test*.java</include>
+      </includes>
+      <resources>
+        <resource>
+          <directory>src/test</directory>
+          <includes>
+            <include>**/*.jelly</include>
+            <include>**/*.xml</include>
+            <include>**/*.xsl</include>
+            <include>**/*.rng</include>
+            <include>**/*.dtd</include>
+            <include>**/*.properties</include>
+            <include>**/*.html</include>
+          </includes>
+        </resource>
+      </resources>
+    </unitTest>
+    
+    <integrationUnitTestPatterns></integrationUnitTestPatterns>
+-->
+
+  </build>
+
+  <reports>
+		<report>maven-javadoc-plugin</report>
+		<report>maven-junit-report-plugin</report>
+		<report>maven-jdepend-plugin</report>
+		<report>maven-checkstyle-plugin</report>
+		<report>maven-jxr-plugin</report>
+		<report>maven-linkcheck-plugin</report>
+		<report>maven-tasklist-plugin </report>
+		<report>maven-changes-plugin</report>
+		<report>maven-file-activity-plugin</report>
+<!--
+		<report>maven-changelog-plugin</report>
+		<report>maven-developer-activity-plugin</report>
+		<report>maven-license-plugin</report>
+-->
+  </reports>
+</project>

Copied: struts/taglib/trunk/src/java/org/apache/struts/taglib/LocalStrings.properties (from r122972, struts/core/trunk/src/share/org/apache/struts/taglib/LocalStrings.properties)
Url: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/java/org/apache/struts/taglib/LocalStrings.properties?view=diff&rev=123703&p1=struts/core/trunk/src/share/org/apache/struts/taglib/LocalStrings.properties&r1=122972&p2=struts/taglib/trunk/src/java/org/apache/struts/taglib/LocalStrings.properties&r2=123703
==============================================================================

Copied: struts/taglib/trunk/src/java/org/apache/struts/taglib/LocalStrings_ja.properties (from r122972, struts/core/trunk/src/share/org/apache/struts/taglib/LocalStrings_ja.properties)
Url: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/java/org/apache/struts/taglib/LocalStrings_ja.properties?view=diff&rev=123703&p1=struts/core/trunk/src/share/org/apache/struts/taglib/LocalStrings_ja.properties&r1=122972&p2=struts/taglib/trunk/src/java/org/apache/struts/taglib/LocalStrings_ja.properties&r2=123703
==============================================================================

Copied: struts/taglib/trunk/src/java/org/apache/struts/taglib/TagUtils.java (from r122972, struts/core/trunk/src/share/org/apache/struts/taglib/TagUtils.java)
Url: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/java/org/apache/struts/taglib/TagUtils.java?view=diff&rev=123703&p1=struts/core/trunk/src/share/org/apache/struts/taglib/TagUtils.java&r1=122972&p2=struts/taglib/trunk/src/java/org/apache/struts/taglib/TagUtils.java&r2=123703
==============================================================================
--- struts/core/trunk/src/share/org/apache/struts/taglib/TagUtils.java	(original)
+++ struts/taglib/trunk/src/java/org/apache/struts/taglib/TagUtils.java	Wed Dec 29 22:56:21 2004
@@ -49,6 +49,7 @@
 import org.apache.struts.util.MessageResources;
 import org.apache.struts.util.ModuleUtils;
 import org.apache.struts.util.RequestUtils;
+import org.apache.struts.util.ResponseUtils;
 
 /**
  * Provides helper methods for JSP tags.
@@ -76,11 +77,6 @@
             MessageResources.getMessageResources("org.apache.struts.taglib.LocalStrings");
 
     /**
-     * Java 1.4 encode method to use instead of deprecated 1.3 version.
-     */
-    private static Method encode = null;
-
-    /**
      * Maps lowercase JSP scope names to their PageContext integer constant
      * values.
      */
@@ -91,15 +87,6 @@
      * Java 1.4 method if available.
      */
     static {
-
-        try {
-            // get version of encode method with two String args
-            Class[] args = new Class[]{String.class, String.class};
-            encode = URLEncoder.class.getMethod("encode", args);
-        } catch (NoSuchMethodException e) {
-            log.debug("Could not find Java 1.4 encode method.  Using deprecated version.", e);
-        }
-
         scopes.put("page", new Integer(PageContext.PAGE_SCOPE));
         scopes.put("request", new Integer(PageContext.REQUEST_SCOPE));
         scopes.put("session", new Integer(PageContext.SESSION_SCOPE));
@@ -593,24 +580,7 @@
      * @return String The encoded url.
      */
     public String encodeURL(String url, String enc) {
-        try {
-
-			if(enc==null || enc.length()==0){
-				enc = "UTF-8";
-			}
-
-            // encode url with new 1.4 method and UTF-8 encoding
-            if (encode != null) {
-                return (String) encode.invoke(null, new Object[]{url,  enc});
-            }
-
-        } catch (IllegalAccessException e) {
-            log.debug("Could not find Java 1.4 encode method.  Using deprecated version.", e);
-        } catch (InvocationTargetException e) {
-            log.debug("Could not find Java 1.4 encode method. Using deprecated version.", e);
-        }
-
-        return URLEncoder.encode(url);
+        return ResponseUtils.encodeURL(url, enc);
     }
 
     /**
@@ -621,51 +591,7 @@
      * @param value The string to be filtered and returned
      */
     public String filter(String value) {
-
-        if (value == null || value.length() == 0) {
-            return value;
-        }
-
-        StringBuffer result = null;
-        String filtered = null;
-        for (int i = 0; i < value.length(); i++) {
-            filtered = null;
-            switch (value.charAt(i)) {
-                case '<':
-                    filtered = "&lt;";
-                    break;
-                case '>':
-                    filtered = "&gt;";
-                    break;
-                case '&':
-                    filtered = "&amp;";
-                    break;
-                case '"':
-                    filtered = "&quot;";
-                    break;
-                case '\'':
-                    filtered = "&#39;";
-                    break;
-            }
-
-            if (result == null) {
-                if (filtered != null) {
-                    result = new StringBuffer(value.length() + 50);
-                    if (i > 0) {
-                        result.append(value.substring(0, i));
-                    }
-                    result.append(filtered);
-                }
-            } else {
-                if (filtered == null) {
-                    result.append(value.charAt(i));
-                } else {
-                    result.append(filtered);
-                }
-            }
-        }
-
-        return result == null ? value : result.toString();
+        return ResponseUtils.filter(value);
     }
 
     /**
@@ -1265,12 +1191,10 @@
      * @param exception The exception to be saved
      */
     public void saveException(PageContext pageContext, Throwable exception) {
-
         pageContext.setAttribute(
                 Globals.EXCEPTION_KEY,
                 exception,
                 PageContext.REQUEST_SCOPE);
-
     }
 
     /**
@@ -1287,18 +1211,16 @@
      */
     public void write(PageContext pageContext, String text)
             throws JspException {
-
         JspWriter writer = pageContext.getOut();
 
         try {
             writer.print(text);
 
         } catch (IOException e) {
-            TagUtils.getInstance().saveException(pageContext, e);
+            saveException(pageContext, e);
             throw new JspException
                     (messages.getMessage("write.io", e.toString()));
         }
-
     }
 
 
@@ -1313,7 +1235,6 @@
      */
     public void writePrevious(PageContext pageContext, String text)
             throws JspException {
-
         JspWriter writer = pageContext.getOut();
         if (writer instanceof BodyContent) {
             writer = ((BodyContent) writer).getEnclosingWriter();
@@ -1323,11 +1244,10 @@
             writer.print(text);
 
         } catch (IOException e) {
-            TagUtils.getInstance().saveException(pageContext, e);
+            saveException(pageContext, e);
             throw new JspException
                     (messages.getMessage("write.io", e.toString()));
         }
-
     }
 
 }

Modified: struts/taglib/trunk/src/java/org/apache/struts/taglib/html/FormTag.java
Url: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/java/org/apache/struts/taglib/html/FormTag.java?view=diff&rev=123703&p1=struts/core/trunk/src/share/org/apache/struts/taglib/html/FormTag.java&r1=122972&p2=struts/taglib/trunk/src/java/org/apache/struts/taglib/html/FormTag.java&r2=123703
==============================================================================
--- struts/core/trunk/src/share/org/apache/struts/taglib/html/FormTag.java	(original)
+++ struts/taglib/trunk/src/java/org/apache/struts/taglib/html/FormTag.java	Wed Dec 29 22:56:21 2004
@@ -529,7 +529,8 @@
     }
 
     /**
-     * Generates a hidden input field with token information, if any.
+     * Generates a hidden input field with token information, if any. The
+     * field is added within a div element for HTML 4.01 Strict compliance.
      * @return A hidden input field containing the token.
      * @since Struts 1.1
      */
@@ -542,7 +543,7 @@
                 (String) session.getAttribute(Globals.TRANSACTION_TOKEN_KEY);
                 
             if (token != null) {
-                results.append("<input type=\"hidden\" name=\"");
+                results.append("<div><input type=\"hidden\" name=\"");
                 results.append(Constants.TOKEN_KEY);
                 results.append("\" value=\"");
                 results.append(token);
@@ -551,6 +552,7 @@
                 } else {
                     results.append("\">");
                 }
+                results.append("</div>");
             }
         }
 

Modified: struts/taglib/trunk/src/test/org/apache/struts/taglib/TestTagUtils.java
Url: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/test/org/apache/struts/taglib/TestTagUtils.java?view=diff&rev=123703&p1=struts/core/trunk/src/test/org/apache/struts/taglib/TestTagUtils.java&r1=123170&p2=struts/taglib/trunk/src/test/org/apache/struts/taglib/TestTagUtils.java&r2=123703
==============================================================================
--- struts/core/trunk/src/test/org/apache/struts/taglib/TestTagUtils.java	(original)
+++ struts/taglib/trunk/src/test/org/apache/struts/taglib/TestTagUtils.java	Wed Dec 29 22:56:21 2004
@@ -106,4 +106,329 @@
                        tagutils.filter("<input type=\"text\" value='Me & You'>"));
     }
 
+    // -------------------------------------------------------------- pageURL()
+
+
+    // Default module (default pagePattern)
+    public void testPageURL1() {
+
+        request.setAttribute(Globals.MODULE_KEY, moduleConfig);
+        request.setPathElements("/myapp", "/action.do", null, null);
+        String page = null;
+        String result = null;
+
+        // Straight substitution
+        page = "/mypages/index.jsp";
+        result = RequestUtils.pageURL(request, page);
+        assertNotNull("straight sub found", result);
+        assertEquals("straight sub value",
+                     "/mypages/index.jsp", result);
+
+
+    }
+
+
+    // Second module (default pagePattern)
+    public void testPageURL2() {
+
+        request.setAttribute(Globals.MODULE_KEY, moduleConfig2);
+        request.setPathElements("/myapp", "/2/action.do", null, null);
+        String page = null;
+        String result = null;
+
+        // Straight substitution
+        page = "/mypages/index.jsp";
+        result = RequestUtils.pageURL(request, page);
+        assertNotNull("straight sub found", result);
+        assertEquals("straight sub value",
+                     "/2/mypages/index.jsp", result);
+
+
+    }
+
+
+    // Third module (custom pagePattern)
+    public void testPageURL3() {
+
+        request.setAttribute(Globals.MODULE_KEY, moduleConfig3);
+        request.setPathElements("/myapp", "/3/action.do", null, null);
+        String page = null;
+        String result = null;
+    }    
+
+    // ---------------------------------------------------- computeParameters()
+
+
+    // No parameters and no transaction token
+    public void testComputeParameters0a() {
+
+        Map map = null;
+        try {
+            map = RequestUtils.computeParameters(page,
+                                                 null, null, null, null,
+                                                 null, null, null, false);
+        } catch (JspException e) {
+            fail("JspException: " + e);
+        }
+        assertNull("Map is null", map);
+
+    }
+
+
+    // No parameters but add transaction token
+    public void testComputeParameters0b() {
+
+        session.setAttribute(Globals.TRANSACTION_TOKEN_KEY, "token");
+        Map map = null;
+        try {
+            map = RequestUtils.computeParameters
+                (page, null, null, null, null,
+                 null, null, null, true);
+        } catch (JspException e) {
+            fail("JspException: " + e);
+        }
+        assertNotNull("Map is not null", map);
+        assertEquals("One parameter in the returned map",
+                     1, map.size());
+        assertTrue("Transaction token parameter present",
+                   map.containsKey(Constants.TOKEN_KEY));
+        assertEquals("Transaction token parameter value",
+                     "token",
+                     (String) map.get(Constants.TOKEN_KEY));
+
+    }
+
+    // Single parameter -- name
+    public void testComputeParameters1a() {
+
+        session.setAttribute("attr", "bar");
+        Map map = null;
+        try {
+            map = RequestUtils.computeParameters
+                (page, "foo", "attr", null, null,
+                 null, null, null, false);
+        } catch (JspException e) {
+            fail("JspException: " + e);
+        }
+        assertNotNull("Map is not null", map);
+        assertEquals("One parameter in the returned map",
+                     1, map.size());
+        assertTrue("Parameter present",
+                   map.containsKey("foo"));
+        assertEquals("Parameter value",
+                     "bar",
+                     (String) map.get("foo"));
+
+    }
+
+
+    // Single parameter -- scope + name
+    public void testComputeParameters1b() {
+
+        request.setAttribute("attr", "bar");
+        Map map = null;
+        try {
+            map = RequestUtils.computeParameters
+                (page, "foo", "attr", null, "request",
+                 null, null, null, false);
+        } catch (JspException e) {
+            fail("JspException: " + e);
+        }
+        assertNotNull("Map is not null", map);
+        assertEquals("One parameter in the returned map",
+                     1, map.size());
+        assertTrue("Parameter present",
+                   map.containsKey("foo"));
+        assertEquals("Parameter value",
+                     "bar",
+                     (String) map.get("foo"));
+
+    }
+
+
+    // Single parameter -- scope + name + property
+    public void testComputeParameters1c() {
+
+        request.setAttribute("attr", new MockFormBean("bar"));
+
+        Map map = null;
+        try {
+            map = RequestUtils.computeParameters
+                (page, "foo", "attr", "stringProperty", "request",
+                 null, null, null, false);
+        } catch (JspException e) {
+            fail("JspException: " + e);
+        }
+        assertNotNull("Map is not null", map);
+        assertEquals("One parameter in the returned map",
+                     1, map.size());
+        assertTrue("Parameter present",
+                   map.containsKey("foo"));
+        assertEquals("Parameter value",
+                     "bar",
+                     (String) map.get("foo"));
+
+    }
+
+
+    // Provided map -- name
+    public void testComputeParameters2a() {
+
+        Map map = new HashMap();
+        map.put("foo1", "bar1");
+        map.put("foo2", "bar2");
+        session.setAttribute("attr", map);
+
+        try {
+            map = RequestUtils.computeParameters
+                (page, null, null, null, null,
+                 "attr", null, null, false);
+        } catch (JspException e) {
+            fail("JspException: " + e);
+        }
+        assertNotNull("Map is not null", map);
+        assertEquals("Two parameter in the returned map",
+                     2, map.size());
+        assertTrue("Parameter foo1 present",
+                   map.containsKey("foo1"));
+        assertEquals("Parameter foo1 value",
+                     "bar1",
+                     (String) map.get("foo1"));
+        assertTrue("Parameter foo2 present",
+                   map.containsKey("foo2"));
+        assertEquals("Parameter foo2 value",
+                     "bar2",
+                     (String) map.get("foo2"));
+
+    }
+
+
+    // Provided map -- scope + name
+    public void testComputeParameters2b() {
+
+        Map map = new HashMap();
+        map.put("foo1", "bar1");
+        map.put("foo2", "bar2");
+        request.setAttribute("attr", map);
+
+        try {
+            map = RequestUtils.computeParameters
+                (page, null, null, null, null,
+                 "attr", null, "request", false);
+        } catch (JspException e) {
+            fail("JspException: " + e);
+        }
+        assertNotNull("Map is not null", map);
+        assertEquals("Two parameter in the returned map",
+                     2, map.size());
+        assertTrue("Parameter foo1 present",
+                   map.containsKey("foo1"));
+        assertEquals("Parameter foo1 value",
+                     "bar1",
+                     (String) map.get("foo1"));
+        assertTrue("Parameter foo2 present",
+                   map.containsKey("foo2"));
+        assertEquals("Parameter foo2 value",
+                     "bar2",
+                     (String) map.get("foo2"));
+
+    }
+
+    // Provided map -- scope + name + property
+    public void testComputeParameters2c() {
+
+        request.setAttribute("attr", new MockFormBean());
+
+        Map map = null;
+        try {
+            map = RequestUtils.computeParameters
+                (page, null, null, null, null,
+                 "attr", "mapProperty", "request", false);
+        } catch (JspException e) {
+            fail("JspException: " + e);
+        }
+        assertNotNull("Map is not null", map);
+        assertEquals("Two parameter in the returned map",
+                     2, map.size());
+        assertTrue("Parameter foo1 present",
+                   map.containsKey("foo1"));
+        assertEquals("Parameter foo1 value",
+                     "bar1",
+                     (String) map.get("foo1"));
+        assertTrue("Parameter foo2 present",
+                   map.containsKey("foo2"));
+        assertEquals("Parameter foo2 value",
+                     "bar2",
+                     (String) map.get("foo2"));
+
+    }
+
+
+    // Provided map -- name with one key and two values
+    public void testComputeParameters2d() {
+
+        Map map = new HashMap();
+        map.put("foo", new String[] { "bar1", "bar2" });
+        session.setAttribute("attr", map);
+
+        try {
+            map = RequestUtils.computeParameters
+                (page, null, null, null, null,
+                 "attr", null, null, false);
+        } catch (JspException e) {
+            fail("JspException: " + e);
+        }
+        assertNotNull("Map is not null", map);
+        assertEquals("One parameter in the returned map",
+                     1, map.size());
+        assertTrue("Parameter foo present",
+                   map.containsKey("foo"));
+        assertTrue("Parameter foo value type",
+                   map.get("foo") instanceof String[]);
+        String values[] = (String[]) map.get("foo");
+        assertEquals("Values count",
+                     2, values.length);
+
+    }
+
+
+    // Kitchen sink combination of parameters with a merge
+    public void testComputeParameters3a() {
+
+        request.setAttribute("attr", new MockFormBean("bar3"));
+        session.setAttribute(Globals.TRANSACTION_TOKEN_KEY, "token");
+
+        Map map = null;
+        try {
+            map = RequestUtils.computeParameters
+                (page, "foo1", "attr", "stringProperty", "request",
+                 "attr", "mapProperty", "request", true);
+        } catch (JspException e) {
+            fail("JspException: " + e);
+        }
+        assertNotNull("Map is not null", map);
+        assertEquals("Three parameter in the returned map",
+                     3, map.size());
+
+        assertTrue("Parameter foo1 present",
+                   map.containsKey("foo1"));
+        assertTrue("Parameter foo1 value type",
+                   map.get("foo1") instanceof String[]);
+        String values[] = (String[]) map.get("foo1");
+        assertEquals("Values count",
+                     2, values.length);
+
+        assertTrue("Parameter foo2 present",
+                   map.containsKey("foo2"));
+        assertEquals("Parameter foo2 value",
+                     "bar2",
+                     (String) map.get("foo2"));
+
+        assertTrue("Transaction token parameter present",
+                   map.containsKey(Constants.TOKEN_KEY));
+        assertEquals("Transaction token parameter value",
+                     "token",
+                     (String) map.get(Constants.TOKEN_KEY));
+    }
+
 }

Copied: struts/tiles/trunk/src/java/org/apache/struts/tiles/RedeployableActionServlet.java (from r122972, struts/core/trunk/src/share/org/apache/struts/actions/RedeployableActionServlet.java)
Url: http://svn.apache.org/viewcvs/struts/tiles/trunk/src/java/org/apache/struts/tiles/RedeployableActionServlet.java?view=diff&rev=123703&p1=struts/core/trunk/src/share/org/apache/struts/actions/RedeployableActionServlet.java&r1=122972&p2=struts/tiles/trunk/src/java/org/apache/struts/tiles/RedeployableActionServlet.java&r2=123703
==============================================================================

Copied: struts/tiles/trunk/src/java/org/apache/struts/tiles/commands/TilesPreProcessor.java (from r122972, struts/core/trunk/src/share/org/apache/struts/chain/commands/servlet/TilesPreProcessor.java)
Url: http://svn.apache.org/viewcvs/struts/tiles/trunk/src/java/org/apache/struts/tiles/commands/TilesPreProcessor.java?view=diff&rev=123703&p1=struts/core/trunk/src/share/org/apache/struts/chain/commands/servlet/TilesPreProcessor.java&r1=122972&p2=struts/tiles/trunk/src/java/org/apache/struts/tiles/commands/TilesPreProcessor.java&r2=123703
==============================================================================

Modified: struts/tiles/trunk/src/java/org/apache/struts/tiles/taglib/util/TagUtils.java
Url: http://svn.apache.org/viewcvs/struts/tiles/trunk/src/java/org/apache/struts/tiles/taglib/util/TagUtils.java?view=diff&rev=123703&p1=struts/core/trunk/src/share/org/apache/struts/taglib/tiles/util/TagUtils.java&r1=122972&p2=struts/tiles/trunk/src/java/org/apache/struts/tiles/taglib/util/TagUtils.java&r2=123703
==============================================================================
--- struts/core/trunk/src/share/org/apache/struts/taglib/tiles/util/TagUtils.java	(original)
+++ struts/tiles/trunk/src/java/org/apache/struts/tiles/taglib/util/TagUtils.java	Wed Dec 29 22:56:21 2004
@@ -19,6 +19,8 @@
 package org.apache.struts.taglib.tiles.util;
 
 import java.lang.reflect.InvocationTargetException;
+import java.util.Map;
+import java.util.HashMap;
 
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.PageContext;
@@ -46,6 +48,24 @@
     public static final boolean debug = true;
     
     /**
+     * Maps lowercase JSP scope names to their PageContext integer constant
+     * values.
+     */
+    private static final Map scopes = new HashMap();
+
+    /**
+     * Initialize the scope names map and the encode variable with the
+     * Java 1.4 method if available.
+     */
+    static {
+        scopes.put("page", new Integer(PageContext.PAGE_SCOPE));
+        scopes.put("request", new Integer(PageContext.REQUEST_SCOPE));
+        scopes.put("session", new Integer(PageContext.SESSION_SCOPE));
+        scopes.put("application", new Integer(PageContext.APPLICATION_SCOPE));
+    }
+
+
+    /**
     * Get scope value from string value
     * @param scopeName Scope as a String.
     * @param defaultValue Returned default value, if not found.
@@ -67,10 +87,29 @@
             return ComponentConstants.COMPONENT_SCOPE;
             
         } else {
-            return org.apache.struts.taglib.TagUtils.getInstance().getScope(
-                scopeName);
+            return getScope(scopeName);
+        }
+    }
+
+    /**
+     * Converts the scope name into its corresponding PageContext constant value.
+     * @param scopeName Can be "page", "request", "session", or "application" in any
+     * case.
+     * @return The constant representing the scope (ie. PageContext.REQUEST_SCOPE).
+     * @throws JspException if the scopeName is not a valid name.
+     */
+    public static int getScope(String scopeName) throws JspException {
+        Integer scope = (Integer) scopes.get(scopeName.toLowerCase());
+
+        if (scope == null) {
+            //throw new JspException(messages.getMessage("lookup.scope", scope));
+            throw new JspException("Unable to retrieve the scope "+scopeName);
         }
+
+        return scope.intValue();
     }
+
+
 
     /**
      * Return the value of the specified property of the specified bean,

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org