You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Apache Wiki <wi...@apache.org> on 2005/05/13 21:12:10 UTC
[Jakarta-tapestry Wiki] Update of "EasyBrowserRedirection" by Patrick Casey
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Jakarta-tapestry Wiki" for change notification.
The following page has been changed by Patrick Casey:
http://wiki.apache.org/jakarta-tapestry/EasyBrowserRedirection
The comment on the change is:
It compiles now :)
------------------------------------------------------------------------------
The following extended RedirectException makes this very easy. Thanks to Paul Ferraro for posting this gem to the mailing list.
=== Example ===
{{{
- public class TapestryRedirectException extends RedirectException
- {
- private static final long serialVersionUID = 4049918285694842678L;
+ import org.apache.tapestry.IDirect;
+ import org.apache.tapestry.IRequestCycle;
+ import org.apache.tapestry.RedirectException;
+ import org.apache.tapestry.Tapestry;
+ import org.apache.tapestry.engine.ILink;
+ import org.apache.tapestry.link.DirectLink;
+
+ public class TapestryRedirectException extends RedirectException {
+
+ private static final long serialVersionUID = 4049918285694842678L;
+
- public RedirectException(String url)
+ public TapestryRedirectException(String url)
{
super(url);
}
- public RedirectException(ILink link)
+ public TapestryRedirectException(ILink link)
{
this(link.getURL());
}
@@ -28, +36 @@
/**
* Use this to redirect the browser to the specified page
*/
- public RedirectException(IRequestCycle cycle, String page)
+ public TapestryRedirectException(IRequestCycle cycle, String page)
{
this(cycle.getEngine().getService(Tapestry.PAGE_SERVICE).getLink(cycle,
cycle.getPage(), new String[] { page }));
@@ -38, +46 @@
* Use this to redirect the browser to the specified page that implements the IExternalPage
* interface
*/
- public RedirectException(IRequestCycle cycle, String page, Object
+ public TapestryRedirectException(IRequestCycle cycle, String page, Object
parameters)
{
this(cycle.getEngine().getService(Tapestry.EXTERNAL_SERVICE).getLink(cycle,
@@ -49, +57 @@
* Use this to redirect the browser to the specified listenener on the component
* that implements the IDirect interface.
*/
- public RedirectException(IRequestCycle cycle, IDirect direct, Object
+ public TapestryRedirectException(IRequestCycle cycle, IDirect direct, Object
parameters)
{
this(cycle.getEngine().getService(Tapestry.DIRECT_SERVICE).getLink(cycle,
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org