Revision: 1110
          http://stripes.svn.sourceforge.net/stripes/?rev=1110&view=rev
Author:   bengunter
Date:     2009-03-06 02:04:21 +0000 (Fri, 06 Mar 2009)

Log Message:
-----------
Applied a fix for FormTag related to STS-523 from the trunk.

Modified Paths:
--------------
    branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/FormTag.java

Modified: branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/FormTag.java
===================================================================
--- branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/FormTag.java 
2009-03-06 02:02:12 UTC (rev 1109)
+++ branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/FormTag.java 
2009-03-06 02:04:21 UTC (rev 1110)
@@ -63,6 +63,14 @@
     /** Stores the value of the action attribute before the context gets 
appended. */
     private String actionWithoutContext;
 
+    /** Stores the value of the beanclass attribute. */
+    private Object beanclass;
+
+    /**
+     * The {...@link ActionBean} class to which the form will submit, as 
determined by the
+     * {...@link ActionResolver}. This may be null if the action attribute is 
set but its value does
+     * not resolve to an {...@link ActionBean}.
+     */
     private Class<? extends ActionBean> actionBeanClass;
 
     /** Builds the action attribute with parameters */
@@ -119,6 +127,8 @@
      *         because of a mis-spelled class name, or a class that's not an 
ActionBean
      */
     public void setBeanclass(Object beanclass) throws StripesJspException {
+        this.beanclass = beanclass;
+
         String url = getActionBeanUrl(beanclass);
         if (url == null) {
             throw new StripesJspException("Could not determine action from 
'beanclass' supplied. " +
@@ -485,8 +495,13 @@
         if (action.startsWith("/")) {
             HttpServletRequest request = (HttpServletRequest) 
getPageContext().getRequest();
             String contextPath = request.getContextPath();
-            if (contextPath.length() > 1 && !action.startsWith(contextPath + 
'/'))
+
+            // *Always* prepend the context path if "beanclass" was used
+            // Otherwise, *only* prepend it if it is not already present
+            if (contextPath.length() > 1
+                    && (beanclass != null || !action.startsWith(contextPath + 
'/'))) {
                 action = contextPath + action;
+            }
         }
         HttpServletResponse response = (HttpServletResponse) 
getPageContext().getResponse();
         return response.encodeURL(action);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to