This is an exceptionally good question. Links will have to be created
completly out of the web application context. I think this is going to
be even more necessary, when the recent changes about URL i18n come into
play...
Andy
Peter Stavrinides schrieb:
I see... I am aware of ComponentClassResolver that you can look at to help you construct the links and resolve valid page names.
Peter
----- Original Message -----
From: "Ville Virtanen" <ville.virta...@cerion.fi>
To: users@tapestry.apache.org
Sent: Wednesday, 11 March, 2009 10:53:56 GMT +02:00 Athens, Beirut, Bucharest,
Istanbul
Subject: Re: How to make link correctly
Thanks for the reply,
Let me rephrase :) What is the best practice for creating
org.apache.tapestry5.Link instances if I have the page class at my disposal?
I see that component resources are not internal and provide functionality I
need, but is it ok to use the service without any component or page? The
name strongly suggest that this service should be only injected to a page or
component and used there?
Can I use it safely in another service, or in AppModule or filter?
- Ville
Peter Stavrinides wrote:
Yes, see org.apache.tapestry5.ComponentResources:
Link link = resources.createPageLink(_page, false, _context);
There are a number of ways to construct a link in Tapestry, choose whats
best for you. From an event you can return a class a Tapestry Page Object
a URI or a Link object, have I missed any?
cheers,
Peter
----- Original Message -----
From: "Ville Virtanen" <ville.virta...@cerion.fi>
To: users@tapestry.apache.org
Sent: Wednesday, 11 March, 2009 10:27:35 GMT +02:00 Athens, Beirut,
Bucharest, Istanbul
Subject: How to make link correctly
Hi,
Can I create page render link or component event link using public
interfaces?
Currently my code uses the internal LinkFactory which was changed to
LinkSource? And at one instance it was using PageRenderRequestParameters
as
input but now again something else...
I do redirects in a very low level sometimes, so I cannot rely on T5 to
transform my String page name etc to correct url, so I do
PageRenderRequestParameters prrp = new
PageRenderRequestParameters(pageName,
new EmptyEventContext());
pageLink = linkFactory.createPageRenderLink(prrp);
response.sendRedirect(pageLink.toRedirectURI());
Is there a better way to do this?
Thanks in advance!
--
View this message in context:
http://www.nabble.com/How-to-make-link-correctly-tp22450579p22450579.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org