Revision: 887
          http://stripes.svn.sourceforge.net/stripes/?rev=887&view=rev
Author:   bengunter
Date:     2008-04-18 21:15:47 -0700 (Fri, 18 Apr 2008)

Log Message:
-----------
Fixed STS-547. Added protected [gs]etAnchor methods to OnwardResolution. 
Subclasses can override these methods and make them public if it makes sense 
for the subclass. RedirectResolution does just that.

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

Modified: trunk/stripes/src/net/sourceforge/stripes/action/OnwardResolution.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/action/OnwardResolution.java      
2008-04-19 03:46:53 UTC (rev 886)
+++ trunk/stripes/src/net/sourceforge/stripes/action/OnwardResolution.java      
2008-04-19 04:15:47 UTC (rev 887)
@@ -39,6 +39,7 @@
     private String path;
     private String event;
     private Map<String,Object> parameters = new HashMap<String,Object>();
+    private String anchor;
 
     /**
      * Default constructor that takes the supplied path and stores it for use.
@@ -81,6 +82,18 @@
         this.path = path;
     }
 
+    /** Get the name of the anchor to be appended to the URL. */
+    protected String getAnchor() {
+        return anchor;
+    }
+
+    /** Set the name of the anchor to be appended to the URL. */
+    @SuppressWarnings("unchecked")
+    protected T setAnchor(String anchor) {
+        this.anchor = anchor;
+        return (T) this;
+    }
+
     /**
      * Method that will work for this class and subclasses; returns a String 
containing the
      * class name, and the path to which it will send the user.
@@ -177,6 +190,9 @@
         if (event != null) {
             builder.setEvent(event);
         }
+        if (anchor != null) {
+            builder.setAnchor(anchor);
+        }
         builder.addParameters(this.parameters);
         return builder.toString();
     }

Modified: 
trunk/stripes/src/net/sourceforge/stripes/action/RedirectResolution.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/action/RedirectResolution.java    
2008-04-19 03:46:53 UTC (rev 886)
+++ trunk/stripes/src/net/sourceforge/stripes/action/RedirectResolution.java    
2008-04-19 04:15:47 UTC (rev 887)
@@ -94,6 +94,18 @@
         super(beanType, event);
     }
 
+    /** This method is overridden to make it public. */
+    @Override
+    public String getAnchor() {
+        return super.getAnchor();
+    }
+
+    /** This method is overridden to make it public. */
+    @Override
+    public RedirectResolution setAnchor(String anchor) {
+        return super.setAnchor(anchor);
+    }
+
     /**
      * If set to true, will cause absolutely all request parameters present in 
the current request
      * to be appended to the redirect URL that will be sent to the browser. 
Since some browsers


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 the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to