On 2/22/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:
I'd interpret your example as a Catalog page with an activation consisting of three strings (catalog, category, product).So, a URL might be "/catalog/sears/games/settlers-of-catan" and the Catalog page would recieve an activation event to inform it of the contents of the path: i.e. public class Catalog { ... void onActivate(String catalog, String category, String product) { ... } }
That would effectively be a good solution.
Tapestry 5 is pretty strict on its name: "catalog" in a URL is a logical page name. This will be mapped to a particular class: com.wonderfulhost.my.app.pages.Catalog perhaps. The case of the word "catalog" doesn't matter. The Catalog page will have a template named "Catalog.html" and that goes in one of only two places: on the class path with Catalog.class, or in WEB-INF (the latter case only applies to application pages, not pages from a library). In terms of your ease-of-use case ... that's an interesting problem. It's a kind of mapping. Certainly T5 doesn't have a construct to handle that right now; I'll try and keep it in mind as something not to prevent. One solution may involve a server-side or client-side redirect, but that's a bit ugly.
In fact, my RFE is coming from the REST solutions, like what Rails is going to go and like Restlet too. There is even a draft RFC on this topic, as you can see on: http://wiki.welldesignedurls.org/URI_Templates Support of URI templates would be a really good way to deal with SEM. Regarding support for I18N of URI, do you have any suggestion on how to make this simple? I'd like to keep the same Java code, use the same naming for my templates (except some would be suffixed by the language code), BUT have "different names" for the page (meaning each language would have its own URI binding). Thanks, Jérôme.
On 2/22/07, Jérôme BERNARD <[EMAIL PROTECTED]> wrote: > Hi, > > Will Tap5 support of kind of URL routing support? > What I mean is that I'd like to route/match URLs such as > http://my.wonderfulhost.com/catalog/${catalog}/${category}/${product} > to a ProductPage having the variable ${catalog}, ${category, and > ${product} automatically filled in. > Or should we do it like Tapestry 4? > > Next related questions is I18N or URI. > Will there be a way to have this kind of use-case: > - a ProductPage page class, > - a Product.html template (english version), > - a Product_fr.html template (french version as you guess :)) > - the URL http://my.wonderfulhost.com/product.html delivering the > english version, > - the URL http://my.wonderfulhost.com/produit.html delivering the > french version. > > I hope my explanation is not too much confusing :-p > > > Thanks, > Jérôme. > > -- > Jérôme BERNARD, > Kalixia, SARL. > http://weblog.kalixia.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Howard M. Lewis Ship TWD Consulting, Inc. Independent J2EE / Open-Source Java Consultant Creator and PMC Chair, Apache Tapestry Creator, Apache HiveMind Professional Tapestry training, mentoring, support and project work. http://howardlewisship.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Jérôme BERNARD, Kalixia, SARL. http://weblog.kalixia.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
