Revision: 551
          http://svn.sourceforge.net/stripes/?rev=551&view=rev
Author:   bengunter
Date:     2007-05-25 15:25:45 -0700 (Fri, 25 May 2007)

Log Message:
-----------
Resolved STS-273: The "stripes:link" tag should not add "_sourcePage" parameter 
when the page requires a pre-action. The _sourcePage parameter is omitted by 
default. There is a new addSourcePage property/attribute that can be set to 
true to cause it to be added.

Modified Paths:
--------------
    trunk/stripes/resources/stripes.tld
    trunk/stripes/src/net/sourceforge/stripes/tag/LinkTagSupport.java

Modified: trunk/stripes/resources/stripes.tld
===================================================================
--- trunk/stripes/resources/stripes.tld 2007-05-25 21:56:17 UTC (rev 550)
+++ trunk/stripes/resources/stripes.tld 2007-05-25 22:25:45 UTC (rev 551)
@@ -787,6 +787,13 @@
                 to the URL/href supplied).
             </description>
             
<name>event</name><required>false</required><rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <description>
+                Indicates if the _sourcePage parameter should be appended to 
the URL. Default
+                value is false.
+            </description>
+            
<name>addSourcePage</name><required>false</required><rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
             <description>

Modified: trunk/stripes/src/net/sourceforge/stripes/tag/LinkTagSupport.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/tag/LinkTagSupport.java   
2007-05-25 21:56:17 UTC (rev 550)
+++ trunk/stripes/src/net/sourceforge/stripes/tag/LinkTagSupport.java   
2007-05-25 22:25:45 UTC (rev 551)
@@ -36,6 +36,7 @@
     private String event;
     private Object beanclass;
     private String url;
+    private boolean addSourcePage = false;
 
     /**
      * Gets the URL that is supplied by the user/developer on the page. This 
is the basis
@@ -100,6 +101,20 @@
     public Object getBeanclass() { return beanclass; }
 
     /**
+     * Get the flag that indicates if the _sourcePage parameter should be
+     * appended to the URL.
+     * 
+     * @return true if _sourcePage is to be appended to the URL; false 
otherwise
+     */
+    public boolean isAddSourcePage() { return addSourcePage; }
+
+    /**
+     * Set the flag that indicates if the _sourcePage parameter should be
+     * appended to the URL.
+     */
+    public void setAddSourcePage(boolean addSourcePage) { this.addSourcePage = 
addSourcePage; }
+
+    /**
      * Returns the base URL that should be used for building the link. This is 
derived from
      * the 'beanclass' attribute if it is set, else from the 'url' attribute.
      *
@@ -153,7 +168,9 @@
         if (this.event != null) {
             builder.addParameter(this.event);
         }
-        builder.addParameter(StripesConstants.URL_KEY_SOURCE_PAGE, 
request.getServletPath());
+        if (addSourcePage) {
+            builder.addParameter(StripesConstants.URL_KEY_SOURCE_PAGE, 
request.getServletPath());
+        }
         builder.addParameters(this.parameters);
 
         return response.encodeURL(builder.toString());


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

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to