You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by sandeepraj singh <sa...@atosorigin.com> on 2010/05/10 08:34:49 UTC
Tapestry5 template name simplification
hi,
As per the tapestry5 documentation
"
In certain cases, Tapestry will simplify the the logical name of a page. For
example, the page class org.example.pages.address.Create Address will be
given a logical name of "address/Create" (the redundant "Address" is removed
as a suffix) "
I wanted to understand, why does tapestry5 take extra pains to do it. Is
there a huge advantage for doing this?
Any explanation would help because, otherwise it looks confusing to see an
altered URL.
Thanks
Sandeep
--
View this message in context: http://old.nabble.com/Tapestry5-template-name-simplification-tp28508162p28508162.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: Tapestry5 template name simplification
Posted by sandeepraj singh <sa...@atosorigin.com>.
Yes Martin,
I agree its just a nice to have feature. I have raised a jira to make it
configurable
Thanks
Martin Strand-4 wrote:
>
> In my experience, this strategy automatically gives prettier URLs in most
> cases but still allows you to have unique class names that make sense:
>
> .details.CustomerDetails --> /details/customer/123
> .details.PaymentDetails --> /details/payment/123
> .list.CustomerList --> /list/customer
> .list.PaymentList --> /list/payment
> .support.SupportIndex --> /support
> .signup.SignupIndex --> /signup
>
> Leaving the package name would make the URLs slightly "uglier".
> This is merely a "nice to have" feature.
>
> On Mon, 10 May 2010 13:53:54 +0200, sandeepraj singh
> <sa...@atosorigin.com> wrote:
>
>>
>> Thanks For the reply Kris,
>>
>> But thats very subjective.I can easily overrule this by having
>> address/EmployeeAddressList and customer/HighlyPaidCustomerList
>>
>> So i was just thinking why this special take care when there is some
>> redundancy due to my pages being named somewhat same to my
>> package(address-->addresslist).
>>
>> I dont want to sound too panicky, but i find it hard to explain the
>> strategy
>> to people when i am training them.
>>
>> People from JSP / Servlet background(like me and thousands here) find the
>> strategy very hard to understand.
>>
>> Thanks
>> Sandeep
>>
>>
>> kristian.marinkovic wrote:
>>>
>>> hi sandeep,
>>>
>>> the reason to do so is to have prettier URLs.
>>>
>>> When developing an application you tend to
>>> group your pages into logical packages. lets
>>> assume your application is able to change
>>> Customer and Address objects. So you'll have
>>> a bunch of pages in the respective packages.
>>> Its very common to have a CustomerList and a
>>> AddressList page that diplays the result of a search.
>>> not altering the URL would result in following page
>>> URLs:
>>> address/addresslist/
>>> customer/customerlist/
>>> (funny note: i really had a customer that considered
>>> above urls as invalid or faulty, because of the
>>> duplication; he expected something like addresslist/)
>>>
>>> T5 will recognize this pattern and change these URLs
>>> to:
>>> address/list
>>> customer/list
>>>
>>> What are the alternatives? You could rename your pages
>>> to List, but then you'll end up with multiple List classes in
>>> different packages. Or you could add an own UrlRewriteRule
>>> for every list page.
>>>
>>>
>>> i hope this helps
>>> g,
>>> kris
>>>
>>>
>>>
>>> Von: sandeepraj singh <sa...@atosorigin.com>
>>> An: users@tapestry.apache.org
>>> Datum: 10.05.2010 08:35
>>> Betreff: Tapestry5 template name simplification
>>>
>>>
>>>
>>>
>>> hi,
>>>
>>> As per the tapestry5 documentation
>>> "
>>> In certain cases, Tapestry will simplify the the logical name of a page.
>>> For
>>> example, the page class org.example.pages.address.Create Address will be
>>> given a logical name of "address/Create" (the redundant "Address" is
>>> removed
>>> as a suffix) "
>>>
>>>
>>>
>>> I wanted to understand, why does tapestry5 take extra pains to do it. Is
>>> there a huge advantage for doing this?
>>> Any explanation would help because, otherwise it looks confusing to see
>>> an
>>> altered URL.
>>>
>>> Thanks
>>> Sandeep
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Tapestry5-template-name-simplification-tp28508162p28508162.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
>
>
>
--
View this message in context: http://old.nabble.com/Tapestry5-template-name-simplification-tp28508162p28520290.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: Tapestry5 template name simplification
Posted by Martin Strand <do...@gmail.com>.
In my experience, this strategy automatically gives prettier URLs in most cases but still allows you to have unique class names that make sense:
.details.CustomerDetails --> /details/customer/123
.details.PaymentDetails --> /details/payment/123
.list.CustomerList --> /list/customer
.list.PaymentList --> /list/payment
.support.SupportIndex --> /support
.signup.SignupIndex --> /signup
Leaving the package name would make the URLs slightly "uglier".
This is merely a "nice to have" feature.
On Mon, 10 May 2010 13:53:54 +0200, sandeepraj singh <sa...@atosorigin.com> wrote:
>
> Thanks For the reply Kris,
>
> But thats very subjective.I can easily overrule this by having
> address/EmployeeAddressList and customer/HighlyPaidCustomerList
>
> So i was just thinking why this special take care when there is some
> redundancy due to my pages being named somewhat same to my
> package(address-->addresslist).
>
> I dont want to sound too panicky, but i find it hard to explain the strategy
> to people when i am training them.
>
> People from JSP / Servlet background(like me and thousands here) find the
> strategy very hard to understand.
>
> Thanks
> Sandeep
>
>
> kristian.marinkovic wrote:
>>
>> hi sandeep,
>>
>> the reason to do so is to have prettier URLs.
>>
>> When developing an application you tend to
>> group your pages into logical packages. lets
>> assume your application is able to change
>> Customer and Address objects. So you'll have
>> a bunch of pages in the respective packages.
>> Its very common to have a CustomerList and a
>> AddressList page that diplays the result of a search.
>> not altering the URL would result in following page
>> URLs:
>> address/addresslist/
>> customer/customerlist/
>> (funny note: i really had a customer that considered
>> above urls as invalid or faulty, because of the
>> duplication; he expected something like addresslist/)
>>
>> T5 will recognize this pattern and change these URLs
>> to:
>> address/list
>> customer/list
>>
>> What are the alternatives? You could rename your pages
>> to List, but then you'll end up with multiple List classes in
>> different packages. Or you could add an own UrlRewriteRule
>> for every list page.
>>
>>
>> i hope this helps
>> g,
>> kris
>>
>>
>>
>> Von: sandeepraj singh <sa...@atosorigin.com>
>> An: users@tapestry.apache.org
>> Datum: 10.05.2010 08:35
>> Betreff: Tapestry5 template name simplification
>>
>>
>>
>>
>> hi,
>>
>> As per the tapestry5 documentation
>> "
>> In certain cases, Tapestry will simplify the the logical name of a page.
>> For
>> example, the page class org.example.pages.address.Create Address will be
>> given a logical name of "address/Create" (the redundant "Address" is
>> removed
>> as a suffix) "
>>
>>
>>
>> I wanted to understand, why does tapestry5 take extra pains to do it. Is
>> there a huge advantage for doing this?
>> Any explanation would help because, otherwise it looks confusing to see an
>> altered URL.
>>
>> Thanks
>> Sandeep
>> --
>> View this message in context:
>> http://old.nabble.com/Tapestry5-template-name-simplification-tp28508162p28508162.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: Tapestry5 template name simplification
Posted by sandeepraj singh <sa...@atosorigin.com>.
Thanks for your inputs Kris ,
I have raised a jira as a "wish" :-)
https://issues.apache.org/jira/browse/TAP5-1142
You can add your self as watcher. Lets see what happens next:)
Regards
Sandeep
kristian.marinkovic wrote:
>
> hi Sandeep,
>
> you're right this solution does not work in any circumstances.
> but when you learn a new framework you'll have to live with
> its features :)
>
> if i recall correctly there have been several suggestions
> on the mailing list to make this feature configurable. i don't
> know what the current state of the discussion is... if there is
> any :)
>
> so you could create an jira issue and/or override the
> ComponentClassResolver with a custom implementation.
>
> g,
> kris
>
>
>
>
>
>
> Von: sandeepraj singh <sa...@atosorigin.com>
> An: users@tapestry.apache.org
> Datum: 10.05.2010 13:54
> Betreff: Re: Tapestry5 template name simplification
>
>
>
>
> Thanks For the reply Kris,
>
> But thats very subjective.I can easily overrule this by having
> address/EmployeeAddressList and customer/HighlyPaidCustomerList
>
> So i was just thinking why this special take care when there is some
> redundancy due to my pages being named somewhat same to my
> package(address-->addresslist).
>
> I dont want to sound too panicky, but i find it hard to explain the
> strategy
> to people when i am training them.
>
> People from JSP / Servlet background(like me and thousands here) find the
> strategy very hard to understand.
>
> Thanks
> Sandeep
>
>
> kristian.marinkovic wrote:
>>
>> hi sandeep,
>>
>> the reason to do so is to have prettier URLs.
>>
>> When developing an application you tend to
>> group your pages into logical packages. lets
>> assume your application is able to change
>> Customer and Address objects. So you'll have
>> a bunch of pages in the respective packages.
>> Its very common to have a CustomerList and a
>> AddressList page that diplays the result of a search.
>> not altering the URL would result in following page
>> URLs:
>> address/addresslist/
>> customer/customerlist/
>> (funny note: i really had a customer that considered
>> above urls as invalid or faulty, because of the
>> duplication; he expected something like addresslist/)
>>
>> T5 will recognize this pattern and change these URLs
>> to:
>> address/list
>> customer/list
>>
>> What are the alternatives? You could rename your pages
>> to List, but then you'll end up with multiple List classes in
>> different packages. Or you could add an own UrlRewriteRule
>> for every list page.
>>
>>
>> i hope this helps
>> g,
>> kris
>>
>>
>>
>> Von: sandeepraj singh <sa...@atosorigin.com>
>> An: users@tapestry.apache.org
>> Datum: 10.05.2010 08:35
>> Betreff: Tapestry5 template name simplification
>>
>>
>>
>>
>> hi,
>>
>> As per the tapestry5 documentation
>> "
>> In certain cases, Tapestry will simplify the the logical name of a page.
>
>> For
>> example, the page class org.example.pages.address.Create Address will be
>> given a logical name of "address/Create" (the redundant "Address" is
>> removed
>> as a suffix) "
>>
>>
>>
>> I wanted to understand, why does tapestry5 take extra pains to do it. Is
>> there a huge advantage for doing this?
>> Any explanation would help because, otherwise it looks confusing to see
> an
>> altered URL.
>>
>> Thanks
>> Sandeep
>> --
>> View this message in context:
>>
> http://old.nabble.com/Tapestry5-template-name-simplification-tp28508162p28508162.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
>>
>>
>>
>>
>
> --
> View this message in context:
> http://old.nabble.com/Tapestry5-template-name-simplification-tp28508162p28510604.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
>
>
>
>
--
View this message in context: http://old.nabble.com/Tapestry5-template-name-simplification-tp28508162p28520209.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: Tapestry5 template name simplification
Posted by Kristian Marinkovic <kr...@porsche.co.at>.
hi Sandeep,
you're right this solution does not work in any circumstances.
but when you learn a new framework you'll have to live with
its features :)
if i recall correctly there have been several suggestions
on the mailing list to make this feature configurable. i don't
know what the current state of the discussion is... if there is
any :)
so you could create an jira issue and/or override the
ComponentClassResolver with a custom implementation.
g,
kris
Von: sandeepraj singh <sa...@atosorigin.com>
An: users@tapestry.apache.org
Datum: 10.05.2010 13:54
Betreff: Re: Tapestry5 template name simplification
Thanks For the reply Kris,
But thats very subjective.I can easily overrule this by having
address/EmployeeAddressList and customer/HighlyPaidCustomerList
So i was just thinking why this special take care when there is some
redundancy due to my pages being named somewhat same to my
package(address-->addresslist).
I dont want to sound too panicky, but i find it hard to explain the
strategy
to people when i am training them.
People from JSP / Servlet background(like me and thousands here) find the
strategy very hard to understand.
Thanks
Sandeep
kristian.marinkovic wrote:
>
> hi sandeep,
>
> the reason to do so is to have prettier URLs.
>
> When developing an application you tend to
> group your pages into logical packages. lets
> assume your application is able to change
> Customer and Address objects. So you'll have
> a bunch of pages in the respective packages.
> Its very common to have a CustomerList and a
> AddressList page that diplays the result of a search.
> not altering the URL would result in following page
> URLs:
> address/addresslist/
> customer/customerlist/
> (funny note: i really had a customer that considered
> above urls as invalid or faulty, because of the
> duplication; he expected something like addresslist/)
>
> T5 will recognize this pattern and change these URLs
> to:
> address/list
> customer/list
>
> What are the alternatives? You could rename your pages
> to List, but then you'll end up with multiple List classes in
> different packages. Or you could add an own UrlRewriteRule
> for every list page.
>
>
> i hope this helps
> g,
> kris
>
>
>
> Von: sandeepraj singh <sa...@atosorigin.com>
> An: users@tapestry.apache.org
> Datum: 10.05.2010 08:35
> Betreff: Tapestry5 template name simplification
>
>
>
>
> hi,
>
> As per the tapestry5 documentation
> "
> In certain cases, Tapestry will simplify the the logical name of a page.
> For
> example, the page class org.example.pages.address.Create Address will be
> given a logical name of "address/Create" (the redundant "Address" is
> removed
> as a suffix) "
>
>
>
> I wanted to understand, why does tapestry5 take extra pains to do it. Is
> there a huge advantage for doing this?
> Any explanation would help because, otherwise it looks confusing to see
an
> altered URL.
>
> Thanks
> Sandeep
> --
> View this message in context:
>
http://old.nabble.com/Tapestry5-template-name-simplification-tp28508162p28508162.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
>
>
>
>
--
View this message in context:
http://old.nabble.com/Tapestry5-template-name-simplification-tp28508162p28510604.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: Tapestry5 template name simplification
Posted by sandeepraj singh <sa...@atosorigin.com>.
Thanks For the reply Kris,
But thats very subjective.I can easily overrule this by having
address/EmployeeAddressList and customer/HighlyPaidCustomerList
So i was just thinking why this special take care when there is some
redundancy due to my pages being named somewhat same to my
package(address-->addresslist).
I dont want to sound too panicky, but i find it hard to explain the strategy
to people when i am training them.
People from JSP / Servlet background(like me and thousands here) find the
strategy very hard to understand.
Thanks
Sandeep
kristian.marinkovic wrote:
>
> hi sandeep,
>
> the reason to do so is to have prettier URLs.
>
> When developing an application you tend to
> group your pages into logical packages. lets
> assume your application is able to change
> Customer and Address objects. So you'll have
> a bunch of pages in the respective packages.
> Its very common to have a CustomerList and a
> AddressList page that diplays the result of a search.
> not altering the URL would result in following page
> URLs:
> address/addresslist/
> customer/customerlist/
> (funny note: i really had a customer that considered
> above urls as invalid or faulty, because of the
> duplication; he expected something like addresslist/)
>
> T5 will recognize this pattern and change these URLs
> to:
> address/list
> customer/list
>
> What are the alternatives? You could rename your pages
> to List, but then you'll end up with multiple List classes in
> different packages. Or you could add an own UrlRewriteRule
> for every list page.
>
>
> i hope this helps
> g,
> kris
>
>
>
> Von: sandeepraj singh <sa...@atosorigin.com>
> An: users@tapestry.apache.org
> Datum: 10.05.2010 08:35
> Betreff: Tapestry5 template name simplification
>
>
>
>
> hi,
>
> As per the tapestry5 documentation
> "
> In certain cases, Tapestry will simplify the the logical name of a page.
> For
> example, the page class org.example.pages.address.Create Address will be
> given a logical name of "address/Create" (the redundant "Address" is
> removed
> as a suffix) "
>
>
>
> I wanted to understand, why does tapestry5 take extra pains to do it. Is
> there a huge advantage for doing this?
> Any explanation would help because, otherwise it looks confusing to see an
> altered URL.
>
> Thanks
> Sandeep
> --
> View this message in context:
> http://old.nabble.com/Tapestry5-template-name-simplification-tp28508162p28508162.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
>
>
>
>
--
View this message in context: http://old.nabble.com/Tapestry5-template-name-simplification-tp28508162p28510604.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: Tapestry5 template name simplification
Posted by Kristian Marinkovic <kr...@porsche.co.at>.
hi sandeep,
the reason to do so is to have prettier URLs.
When developing an application you tend to
group your pages into logical packages. lets
assume your application is able to change
Customer and Address objects. So you'll have
a bunch of pages in the respective packages.
Its very common to have a CustomerList and a
AddressList page that diplays the result of a search.
not altering the URL would result in following page
URLs:
address/addresslist/
customer/customerlist/
(funny note: i really had a customer that considered
above urls as invalid or faulty, because of the
duplication; he expected something like addresslist/)
T5 will recognize this pattern and change these URLs
to:
address/list
customer/list
What are the alternatives? You could rename your pages
to List, but then you'll end up with multiple List classes in
different packages. Or you could add an own UrlRewriteRule
for every list page.
i hope this helps
g,
kris
Von: sandeepraj singh <sa...@atosorigin.com>
An: users@tapestry.apache.org
Datum: 10.05.2010 08:35
Betreff: Tapestry5 template name simplification
hi,
As per the tapestry5 documentation
"
In certain cases, Tapestry will simplify the the logical name of a page.
For
example, the page class org.example.pages.address.Create Address will be
given a logical name of "address/Create" (the redundant "Address" is
removed
as a suffix) "
I wanted to understand, why does tapestry5 take extra pains to do it. Is
there a huge advantage for doing this?
Any explanation would help because, otherwise it looks confusing to see an
altered URL.
Thanks
Sandeep
--
View this message in context:
http://old.nabble.com/Tapestry5-template-name-simplification-tp28508162p28508162.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