You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ian Petzer <ia...@gmail.com> on 2008/10/23 17:33:33 UTC
Deep linking to tapestry pages from jps. Conversion
Hi,
We are busy converting our Struts/Tiles based application to Tapestry. Until
this is complete I have am required to generate links to the new Tapestry
pages correctly from the jsp pages.
Normally this isn't a problem as I used the url pattern of:
<HOST>/<PAGE>/<PARAM1>/<PARAM2>/PARAM3
Now, please consider the situation where my params have following values:
PARAM1 = Hello
PARAM2 = relative/url
PARAM3 = colon:seperated
So if I follow my previous url pattern i would get
<HOST>/<PAGE>/Hello/relative/url/colon:seperated
This of course doesn't work as that url is interpreted as having four
params: [Hello, relative, url, colon:seperated] instead of the three that I
define.
When I use a pageLink object on Tapestry pages this isn't a problem as
param2 is double url encoded, so that relative/url --> relative%252Furl
However the colon in param3 isn't double url encoded.
I would really appreciate it if someone could indicate the rules which are
used when forming these urls or if someone could suggest an approach to
generate these urls. Possibly a reverse @Inject of the relevant Tapestry
object into my Spring service where I could call a method to convert the
context values.
Thanks,
Ian
Re: Deep linking to tapestry pages from jps. Conversion
Posted by Ian Petzer <ia...@gmail.com>.
Hi Howard,
Unfortantely this approach of encoding the information is request params is
not really ideal.
As Russel has said, we are halfway through converting our application. We
have created Tapestry pages to supply some new functionality (various RSS
feeds in this case) however we need to link to this functionality from
existing jsp pages which haven't been converted yet and new tapestry pages.
The new tapestry pages are a doddle as we can simply use a pageLink and pass
through the relative url as a param in the context for the actionLink.
What I'm really looking for is guidance on hwo to create a Link to mimic
what is created by the pageLink component. Even if you could just point me
at the right class which encodes the param values and introduces the special
behaviour for slashes in param values being double encoded.
Thanks for your help,
Ian
On Mon, Oct 27, 2008 at 10:32 AM, Russell Brown <Ru...@ioko.com>wrote:
> Hi Borut,
> We are migrating a Struts app at the moment so if you have any specific
> questions about stuff then fire away as we _may_ have solved one or two
> problems that you might face already.
>
> Such a guide would be a good idea: it is ideal to start a nice new app with
> a nice new framework but in the real world most people are working on legacy
> applications and migration is the normal use case. If T5 wants any real
> penetration then thinking about migrating users from Struts to T5 is a must.
> Although it is essentially a "marketing" problem and most developers
> struggle with marketing.
>
> Cheers
>
> Russell
>
> -----Original Message-----
> From: Borut Bolčina [mailto:borut.bolcina@gmail.com]
> Sent: 24 October 2008 21:04
> To: Tapestry users
> Subject: Re: Deep linking to tapestry pages from jps. Conversion
>
> Hi,
>
> it would be great if there was also a JSP transition guide. We have a large
> JSP application at the moment and my intention is to replace it gradually
> with Tapestry 5. Any advice on how to do it *the right way* would be more
> than welcome!
>
> Regards,
> Borut
>
> 2008/10/24 Howard Lewis Ship <hl...@gmail.com>
>
> > For deep linking purposes, could you pass the information as normal
> > query parameters?
> >
> > You could then @Inject the Request object to retrieve those values.
> > You can also use the ContextValueEncoder service to decode them to
> > appropriate types.
> > This work would be done in the page's activate event handler method.
> >
> > This is a more servlet-style of development, which may be the right
> > approach for a transitional application.
> >
> > On Thu, Oct 23, 2008 at 8:33 AM, Ian Petzer <ia...@gmail.com> wrote:
> > > Hi,
> > >
> > > We are busy converting our Struts/Tiles based application to Tapestry.
> > Until
> > > this is complete I have am required to generate links to the new
> Tapestry
> > > pages correctly from the jsp pages.
> > >
> > > Normally this isn't a problem as I used the url pattern of:
> > > <HOST>/<PAGE>/<PARAM1>/<PARAM2>/PARAM3
> > >
> > > Now, please consider the situation where my params have following
> values:
> > >
> > > PARAM1 = Hello
> > > PARAM2 = relative/url
> > > PARAM3 = colon:seperated
> > >
> > > So if I follow my previous url pattern i would get
> > >
> > > <HOST>/<PAGE>/Hello/relative/url/colon:seperated
> > >
> > > This of course doesn't work as that url is interpreted as having four
> > > params: [Hello, relative, url, colon:seperated] instead of the three
> that
> > I
> > > define.
> > >
> > > When I use a pageLink object on Tapestry pages this isn't a problem as
> > > param2 is double url encoded, so that relative/url --> relative%252Furl
> > >
> > > However the colon in param3 isn't double url encoded.
> > >
> > > I would really appreciate it if someone could indicate the rules which
> > are
> > > used when forming these urls or if someone could suggest an approach to
> > > generate these urls. Possibly a reverse @Inject of the relevant
> Tapestry
> > > object into my Spring service where I could call a method to convert
> the
> > > context values.
> > >
> > > Thanks,
> > > Ian
> > >
> >
> >
> >
> > --
> > Howard M. Lewis Ship
> >
> > Creator Apache Tapestry and Apache HiveMind
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
RE: Deep linking to tapestry pages from jps. Conversion
Posted by Russell Brown <Ru...@ioko.com>.
Hi Borut,
We are migrating a Struts app at the moment so if you have any specific questions about stuff then fire away as we _may_ have solved one or two problems that you might face already.
Such a guide would be a good idea: it is ideal to start a nice new app with a nice new framework but in the real world most people are working on legacy applications and migration is the normal use case. If T5 wants any real penetration then thinking about migrating users from Struts to T5 is a must. Although it is essentially a "marketing" problem and most developers struggle with marketing.
Cheers
Russell
-----Original Message-----
From: Borut Bolčina [mailto:borut.bolcina@gmail.com]
Sent: 24 October 2008 21:04
To: Tapestry users
Subject: Re: Deep linking to tapestry pages from jps. Conversion
Hi,
it would be great if there was also a JSP transition guide. We have a large
JSP application at the moment and my intention is to replace it gradually
with Tapestry 5. Any advice on how to do it *the right way* would be more
than welcome!
Regards,
Borut
2008/10/24 Howard Lewis Ship <hl...@gmail.com>
> For deep linking purposes, could you pass the information as normal
> query parameters?
>
> You could then @Inject the Request object to retrieve those values.
> You can also use the ContextValueEncoder service to decode them to
> appropriate types.
> This work would be done in the page's activate event handler method.
>
> This is a more servlet-style of development, which may be the right
> approach for a transitional application.
>
> On Thu, Oct 23, 2008 at 8:33 AM, Ian Petzer <ia...@gmail.com> wrote:
> > Hi,
> >
> > We are busy converting our Struts/Tiles based application to Tapestry.
> Until
> > this is complete I have am required to generate links to the new Tapestry
> > pages correctly from the jsp pages.
> >
> > Normally this isn't a problem as I used the url pattern of:
> > <HOST>/<PAGE>/<PARAM1>/<PARAM2>/PARAM3
> >
> > Now, please consider the situation where my params have following values:
> >
> > PARAM1 = Hello
> > PARAM2 = relative/url
> > PARAM3 = colon:seperated
> >
> > So if I follow my previous url pattern i would get
> >
> > <HOST>/<PAGE>/Hello/relative/url/colon:seperated
> >
> > This of course doesn't work as that url is interpreted as having four
> > params: [Hello, relative, url, colon:seperated] instead of the three that
> I
> > define.
> >
> > When I use a pageLink object on Tapestry pages this isn't a problem as
> > param2 is double url encoded, so that relative/url --> relative%252Furl
> >
> > However the colon in param3 isn't double url encoded.
> >
> > I would really appreciate it if someone could indicate the rules which
> are
> > used when forming these urls or if someone could suggest an approach to
> > generate these urls. Possibly a reverse @Inject of the relevant Tapestry
> > object into my Spring service where I could call a method to convert the
> > context values.
> >
> > Thanks,
> > Ian
> >
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: Deep linking to tapestry pages from jps. Conversion
Posted by Borut Bolčina <bo...@gmail.com>.
Hi,
it would be great if there was also a JSP transition guide. We have a large
JSP application at the moment and my intention is to replace it gradually
with Tapestry 5. Any advice on how to do it *the right way* would be more
than welcome!
Regards,
Borut
2008/10/24 Howard Lewis Ship <hl...@gmail.com>
> For deep linking purposes, could you pass the information as normal
> query parameters?
>
> You could then @Inject the Request object to retrieve those values.
> You can also use the ContextValueEncoder service to decode them to
> appropriate types.
> This work would be done in the page's activate event handler method.
>
> This is a more servlet-style of development, which may be the right
> approach for a transitional application.
>
> On Thu, Oct 23, 2008 at 8:33 AM, Ian Petzer <ia...@gmail.com> wrote:
> > Hi,
> >
> > We are busy converting our Struts/Tiles based application to Tapestry.
> Until
> > this is complete I have am required to generate links to the new Tapestry
> > pages correctly from the jsp pages.
> >
> > Normally this isn't a problem as I used the url pattern of:
> > <HOST>/<PAGE>/<PARAM1>/<PARAM2>/PARAM3
> >
> > Now, please consider the situation where my params have following values:
> >
> > PARAM1 = Hello
> > PARAM2 = relative/url
> > PARAM3 = colon:seperated
> >
> > So if I follow my previous url pattern i would get
> >
> > <HOST>/<PAGE>/Hello/relative/url/colon:seperated
> >
> > This of course doesn't work as that url is interpreted as having four
> > params: [Hello, relative, url, colon:seperated] instead of the three that
> I
> > define.
> >
> > When I use a pageLink object on Tapestry pages this isn't a problem as
> > param2 is double url encoded, so that relative/url --> relative%252Furl
> >
> > However the colon in param3 isn't double url encoded.
> >
> > I would really appreciate it if someone could indicate the rules which
> are
> > used when forming these urls or if someone could suggest an approach to
> > generate these urls. Possibly a reverse @Inject of the relevant Tapestry
> > object into my Spring service where I could call a method to convert the
> > context values.
> >
> > Thanks,
> > Ian
> >
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: Deep linking to tapestry pages from jps. Conversion
Posted by Howard Lewis Ship <hl...@gmail.com>.
For deep linking purposes, could you pass the information as normal
query parameters?
You could then @Inject the Request object to retrieve those values.
You can also use the ContextValueEncoder service to decode them to
appropriate types.
This work would be done in the page's activate event handler method.
This is a more servlet-style of development, which may be the right
approach for a transitional application.
On Thu, Oct 23, 2008 at 8:33 AM, Ian Petzer <ia...@gmail.com> wrote:
> Hi,
>
> We are busy converting our Struts/Tiles based application to Tapestry. Until
> this is complete I have am required to generate links to the new Tapestry
> pages correctly from the jsp pages.
>
> Normally this isn't a problem as I used the url pattern of:
> <HOST>/<PAGE>/<PARAM1>/<PARAM2>/PARAM3
>
> Now, please consider the situation where my params have following values:
>
> PARAM1 = Hello
> PARAM2 = relative/url
> PARAM3 = colon:seperated
>
> So if I follow my previous url pattern i would get
>
> <HOST>/<PAGE>/Hello/relative/url/colon:seperated
>
> This of course doesn't work as that url is interpreted as having four
> params: [Hello, relative, url, colon:seperated] instead of the three that I
> define.
>
> When I use a pageLink object on Tapestry pages this isn't a problem as
> param2 is double url encoded, so that relative/url --> relative%252Furl
>
> However the colon in param3 isn't double url encoded.
>
> I would really appreciate it if someone could indicate the rules which are
> used when forming these urls or if someone could suggest an approach to
> generate these urls. Possibly a reverse @Inject of the relevant Tapestry
> object into my Spring service where I could call a method to convert the
> context values.
>
> Thanks,
> Ian
>
--
Howard M. Lewis Ship
Creator Apache Tapestry and Apache HiveMind
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org