You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by hese <10...@gmail.com> on 2011/07/28 23:18:29 UTC

Can i have class names different from the calling url path?

All,

What I want is to access

pages.admin.users.UserEdit from the url /admin/users/edit
pages.admin.users.ActiveUsers from the url /admin/users/active

I dont want to change UserEdit to 'Edit' because Edit is a very generic name
for a class...but when the same thing appears in the url from a restful
perspective it doesn't look nice - having a url like /admin/users/useredit,
or /admin/users/activeusers

Currently, the way I know is tapestry just puts the page name as the url
path, but I want to be able to configure them differently.

Thanks!



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Can-i-have-class-names-different-from-the-calling-url-path-tp4644276p4644276.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Can i have class names different from the calling url path?

Posted by hese <10...@gmail.com>.
Cool!! You always have answers.  Thanks!

The thing I love about this forum is I know I will get a reply within an
hour max!






--
View this message in context: http://tapestry.1045711.n5.nabble.com/Can-i-have-class-names-different-from-the-calling-url-path-tp4644276p4644490.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Can i have class names different from the calling url path?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 28 Jul 2011 18:18:29 -0300, hese <10...@gmail.com> wrote:

> All,

Hi!

> What I want is to access
> pages.admin.users.UserEdit from the url /admin/users/edit

Rename it to UsersEdit and Tapestry already does what you want.

> pages.admin.users.ActiveUsers from the url /admin/users/active

Tapestry already does that. :) The package name, if present in the class  
name, is stripped to give the page URL. Both /admin/users/edit and  
/admin/users/activeusers are valid URLs. When generating links to this  
page, Tapestry will use the short URL (/admin/users/edit). Haven't you  
tried it yet?

> Currently, the way I know is tapestry just puts the page name as the url
> path, but I want to be able to configure them differently.

If you want full control, use the LinkTransformer API. There's a very nice  
blog post by Igor Drobiazko here:  
http://blog.tapestry5.de/index.php/2010/09/06/new-url-rewriting-api/.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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