Revision: 1023
          http://stripes.svn.sourceforge.net/stripes/?rev=1023&view=rev
Author:   bengunter
Date:     2008-12-23 19:11:37 +0000 (Tue, 23 Dec 2008)

Log Message:
-----------
Fixed the second part of STS-596. OnwardResolution.setEvent(null) will prevent 
the event name from being added to the URL.

Modified Paths:
--------------
    trunk/stripes/src/net/sourceforge/stripes/action/OnwardResolution.java

Modified: trunk/stripes/src/net/sourceforge/stripes/action/OnwardResolution.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/action/OnwardResolution.java      
2008-12-23 16:57:11 UTC (rev 1022)
+++ trunk/stripes/src/net/sourceforge/stripes/action/OnwardResolution.java      
2008-12-23 19:11:37 UTC (rev 1023)
@@ -36,8 +36,11 @@
  * @author Tim Fennell
  */
 public abstract class OnwardResolution<T extends OnwardResolution<T>> 
implements Resolution {
+    /** Initial value for fields to indicate they were not changed when null 
has special meaning */
+    private static final String VALUE_NOT_SET = "VALUE_NOT_SET";
+
     private String path;
-    private String event;
+    private String event = VALUE_NOT_SET;
     private Map<String,Object> parameters = new HashMap<String,Object>();
     private String anchor;
 
@@ -187,8 +190,8 @@
      */
     public String getUrl(Locale locale) {
         UrlBuilder builder = new UrlBuilder(locale, path, false);
-        if (event != null) {
-            builder.setEvent(event);
+        if (event != VALUE_NOT_SET) {
+            builder.setEvent(event == null || event.length() < 1 ? null : 
event);
         }
         if (anchor != null) {
             builder.setAnchor(anchor);


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