Revision: 636
          http://stripes.svn.sourceforge.net/stripes/?rev=636&view=rev
Author:   bengunter
Date:     2007-11-21 21:35:28 -0800 (Wed, 21 Nov 2007)

Log Message:
-----------
STS-262. When constructing a URL, do not attempt to add URI parameters if the 
given base path does not *exactly* match a @UrlBinding base path. Without this 
restriction, a @UrlBinding("/path/{foo}/{bar}.action") would hide resources 
under /path, returning a 404. It also allows for Resolutions to manually 
constructed clean URLs.

Modified Paths:
--------------
    trunk/stripes/src/net/sourceforge/stripes/util/UrlBuilder.java

Modified: trunk/stripes/src/net/sourceforge/stripes/util/UrlBuilder.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/util/UrlBuilder.java      
2007-11-21 20:59:19 UTC (rev 635)
+++ trunk/stripes/src/net/sourceforge/stripes/util/UrlBuilder.java      
2007-11-22 05:35:28 UTC (rev 636)
@@ -393,6 +393,11 @@
             return baseUrl;
         }
 
+        // if any extra path info is present then do not add URI parameters
+        if (binding.getPath().length() < baseUrl.length()) {
+            return baseUrl;
+        }
+
         Map<String, Parameter> map = new HashMap<String, Parameter>();
         for (Parameter p : parameters) {
             if (!map.containsKey(p.name))
@@ -400,7 +405,7 @@
         }
 
         StringBuilder buf = new StringBuilder(256);
-        buf.append(binding.getPath());
+        buf.append(baseUrl);
 
         String nextLiteral = null;
         for (Object component : binding.getComponents()) {


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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to