Gmane
From: Paul Ferraro <pmf8 <at> columbia.edu>
Subject: Re: Another Tapestry-driven web site launched
Newsgroups: gmane.comp.java.tapestry.user
Date: 2004-07-26 21:23:21 GMT (4 years, 4 weeks, 5 days, 2 hours and 53 minutes ago)
I decided to implement my own url scheme for the following reasons:
- better J2EE security control
- more user friendly
- more search engine friendly

Here's how I did it...

There are 2 parts: generating and interpreting.

To generate the urls, I use custom PageLink and ExternalLink components 
that utilize a custom ILink implementation that generate the urls using 
the following pattern:
<path-to-page-specification>/<page-name>.htm
The path-to-page-specification is taken from my application specification.

e.g.
<page name="crisisresolution" 
specification-path="resolution/CrisisResolution.page"/>
path-to-page-specification = resolution/
page-name = crisisresolution
generated url = /resolution/crisisresolution.htm

Using lower case page names was done at the insistence of my site 
developer...

To interpret the urls, I have a custom Tapestry servlet that is mapped 
to the url pattern *.htm.
In my service() method, if the url query string contains "sp" (i.e. 
Tapestry.PARAMETERS_QUERY_PARAMETER_NAME), then I generate a Tapestry 
external link, if not I generate a page link.

e.g.
http://www.identitytheft911.com/resolution/crisisresolution.htm
... translates to ...
http://www.identitytheft911.com/app?service=page/crisisresolution

http://www.identitytheft911.com/login.htm?sp=T
... translates to ...
http://www.identitytheft911.com/app?service=external/login&sp=T

I then just do a simple servlet forward to the translated url.

Paul

Jamie Orchard-Hays wrote:

>Paul, how are you doing the URLs? I see they all have normal
>/path/to/myfile.htm paths.
>
>Jamie
>
>----- Original Message ----- 
>From: "Paul Ferraro" <pmf8 <at> columbia.edu>
>To: "Tapestry users" <tapestry-user <at> jakarta.apache.org>
>Sent: Monday, July 26, 2004 4:23 PM
>Subject: Another Tapestry-driven web site launched
>
>
>  
>
>>We've just completed the month long task of converting our company's
>>300+ page public web site from JSPs to Tapestry.
>>
>>http://www.identitytheft911.com
>>
>>Features of interest:
>>- Friendly URLs for page and external services (e.g. home.htm,
>>resolution/crisisresolution.htm)
>>- Virtual host-driven "localization" (3 branded sites generated from the
>>same web application)
>>    (see http://www.libertyidtheft.com,
>>http://www.identitytheft911-usmc.com)
>>- J2EE security (utilizes friendly URLs)
>>    (see http://www.identitytheft911-usmc.com)
>>
>>Paul
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe <at> jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help <at> jakarta.apache.org
>>
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe <at> jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help <at> jakarta.apache.org
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe <at> jakarta.apache.org
For additional commands, e-mail: tapestry-user-help <at> jakarta.apache.org