tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tapestry-...@jakarta.apache.org
Subject [Jakarta Tapestry Wiki] Updated: FriendlyUrls
Date Thu, 16 Dec 2004 19:38:32 GMT
   Date: 2004-12-16T11:38:31
   Editor: JamieOrchardHays <jamie@dang.com>
   Wiki: Jakarta Tapestry Wiki
   Page: FriendlyUrls
   URL: http://wiki.apache.org/jakarta-tapestry/FriendlyUrls

   no comment

Change Log:

------------------------------------------------------------------------------
@@ -105,6 +105,27 @@
       *  Perl5 pattern for library ids.  Letter followed
 }}}
 
+In order for nested directories to work properly with Tables, a modification needs to be
made to {{{org.apache.tapestry.util.io.ComponentAddressAdaptor}}}:
+
+{{{
+public Object unsqueeze(DataSqueezer squeezer, String string) throws IOException
+    {
+-       int separator = string.indexOf(SEPARATOR);
++        //FriendlyURL patch
++        int separator = string.lastIndexOf(SEPARATOR);
+        
+        if (separator < 0)
+            throw new IOException(Tapestry.getMessage("ComponentAddressAdaptor.no-separator"));
+
+        String pageName = string.substring(1, separator);
+        String idPath = string.substring(separator + 1);
+        if (idPath.equals(""))
+        	idPath = null;
+
+        return new ComponentAddress(pageName, idPath);
+    }
+}}}
+
 Here are some examples of standard Tapestry URLs side by side with their friendly URL counterparts:
 
 ||<:>'''Service'''||<:>'''Standard Tapestry URL'''||<:>'''Friendly URL'''||

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Mime
View raw message