You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by ta...@jakarta.apache.org on 2004/12/12 17:32:30 UTC

[Jakarta Tapestry Wiki] Updated: FriendlyUrls

   Date: 2004-12-12T08:32:30
   Editor: HowardLewisShip <hl...@apache.org>
   Wiki: Jakarta Tapestry Wiki
   Page: FriendlyUrls
   URL: http://wiki.apache.org/jakarta-tapestry/FriendlyUrls

   no comment

Change Log:

------------------------------------------------------------------------------
@@ -701,3 +701,32 @@
 
 </web-app>
 }}}
+
+= Tapestry 3.1 =
+
+HowardLewisShip: I've implemented something similar to this for Tapestry 3.1, that results in prettier URLs similar to what Paul's accomplished with his patch to Tapestry  3.0.  However, Paul has some good ideas beyond what I've accomplished so far, such as mapping /app?service=foo to /foo.do ... and these, too, will appear in 3.1. There's a couple of new levels of abstraction between the service (which has information needed to be encoded into the URL) and the actual link (the combination of URL and query parameters), with new objects, !ServiceEncoders, responsible for converting query parameter information into path information, and vice versa.  In other words, slick, extensible and adaptable.  For example, the page and direct services can be utilized with two modifications:
+
+web.xml:
+
+{{{
+  <servlet-mapping>
+    <servlet-name>workbench</servlet-name>
+    <url-pattern>*.page</url-pattern>
+  </servlet-mapping>
+  
+  <servlet-mapping>
+    <servlet-name>workbench</servlet-name>
+    <url-pattern>*.direct</url-pattern>
+  </servlet-mapping>
+}}}
+
+hivemodule.xml:
+
+{{{
+  <contribution configuration-id="tapestry.url.ServiceEncoders">
+    <path-encoder id="direct" extension="direct" service="direct"/>
+    <path-encoder id="page" extension="page" service="page"/>
+  </contribution>
+}}}
+
+At this point, the application will generate URLs like /context/Home.page (equivalent to /context/app?service=page/Home) and /context/Home.direct?component=foo (equivalent to /app?service=direct/0/Home/foo).

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


Re: [Jakarta Tapestry Wiki] Updated: FriendlyUrls

Posted by Jamie Orchard-Hays <ja...@dang.com>.
".do"? What are we, Struts!?!?! <grin>

I see that you're making the extension configurable. Way cool. I'm  
actually using Paul's patch for our Registrar module at Darden. I went  
with ".tap" and ".svc" for the extensions.

Keep up the good work, guys!

Jamie


On Dec 12, 2004, at 11:32 AM, tapestry-dev@jakarta.apache.org wrote:

>    Date: 2004-12-12T08:32:30
>    Editor: HowardLewisShip <hl...@apache.org>
>    Wiki: Jakarta Tapestry Wiki
>    Page: FriendlyUrls
>    URL: http://wiki.apache.org/jakarta-tapestry/FriendlyUrls
>
>    no comment
>
> Change Log:
>
> ----------------------------------------------------------------------- 
> -------
> @@ -701,3 +701,32 @@
>
>  </web-app>
>  }}}
> +
> += Tapestry 3.1 =
> +
> +HowardLewisShip: I've implemented something similar to this for  
> Tapestry 3.1, that results in prettier URLs similar to what Paul's  
> accomplished with his patch to Tapestry  3.0.  However, Paul has some  
> good ideas beyond what I've accomplished so far, such as mapping  
> /app?service=foo to /foo.do ... and these, too, will appear in 3.1.  
> There's a couple of new levels of abstraction between the service  
> (which has information needed to be encoded into the URL) and the  
> actual link (the combination of URL and query parameters), with new  
> objects, !ServiceEncoders, responsible for converting query parameter  
> information into path information, and vice versa.  In other words,  
> slick, extensible and adaptable.  For example, the page and direct  
> services can be utilized with two modifications:
> +
> +web.xml:
> +
> +{{{
> +  <servlet-mapping>
> +    <servlet-name>workbench</servlet-name>
> +    <url-pattern>*.page</url-pattern>
> +  </servlet-mapping>
> +
> +  <servlet-mapping>
> +    <servlet-name>workbench</servlet-name>
> +    <url-pattern>*.direct</url-pattern>
> +  </servlet-mapping>
> +}}}
> +
> +hivemodule.xml:
> +
> +{{{
> +  <contribution configuration-id="tapestry.url.ServiceEncoders">
> +    <path-encoder id="direct" extension="direct" service="direct"/>
> +    <path-encoder id="page" extension="page" service="page"/>
> +  </contribution>
> +}}}
> +
> +At this point, the application will generate URLs like  
> /context/Home.page (equivalent to /context/app?service=page/Home) and  
> /context/Home.direct?component=foo (equivalent to  
> /app?service=direct/0/Home/foo).
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>


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