Revision: 1016
          http://stripes.svn.sourceforge.net/stripes/?rev=1016&view=rev
Author:   bengunter
Date:     2008-12-23 15:53:51 +0000 (Tue, 23 Dec 2008)

Log Message:
-----------
Fixed both STS-596 and STS-626. If the event= attribute of any tag that extends 
LinkTagSupport is set to null or "" then the event will be set to null on the 
UrlBuilder, excluding it from the URL altogether.

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

Modified: trunk/stripes/src/net/sourceforge/stripes/tag/LinkTagSupport.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/tag/LinkTagSupport.java   
2008-12-23 14:57:47 UTC (rev 1015)
+++ trunk/stripes/src/net/sourceforge/stripes/tag/LinkTagSupport.java   
2008-12-23 15:53:51 UTC (rev 1016)
@@ -33,8 +33,11 @@
  * @since Stripes 1.4
  */
 public abstract class LinkTagSupport extends HtmlTagSupport implements 
ParameterizableTag {
+    /** Initial value for fields to indicate they were not set by a tag 
attribute. */
+    private static final String VALUE_NOT_SET = "VALUE_NOT_SET";
+
     private Map<String,Object> parameters = new HashMap<String,Object>();
-    private String event;
+    private String event = VALUE_NOT_SET;
     private Object beanclass;
     private String url;
     private String anchor;
@@ -187,8 +190,8 @@
         // the HtmlTagSupport will HtmlEncode the ampersands for us
         String base = getPreferredBaseUrl();
         UrlBuilder builder = new 
UrlBuilder(pageContext.getRequest().getLocale(), base, false);
-        if (this.event != null) {
-            builder.setEvent(this.event);
+        if (this.event != VALUE_NOT_SET) {
+            builder.setEvent(this.event == null || this.event.length() < 1 ? 
null : this.event);
         }
         if (addSourcePage) {
             builder.addParameter(StripesConstants.URL_KEY_SOURCE_PAGE,


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

------------------------------------------------------------------------------
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to