Probably not many are interested because it is a T4  problem, but who knows?

Some days ago I have asked about how in T4 redirect the browser to an
external web site after submitting to a listener in a page.
Martin Strand provided me a solution using an ILink.

However that led me to another problem because in my pages I was
handling exceptions returning to a specific Error Page.

So I had a listener that had to return an ILink when all was working as
expected and and an IPage in case of message error to be displayed.

I have found a way to get the link to the page here:

http://wiki.apache.org/tapestry/EasyBrowserRedirection

and hence to redirect to my error page I have used this:

ILink
link=this.getRequestCycle().getEngine().getInfrastructure().getLinkFactory().constructLink(
                    TapestryRedirectException.getPageService(),false,
                   
TapestryRedirectException.getLinkParams("MyPageClassName"),false);


          
Since I had to ad some parameters to the page I didn't return directly
the link but I build a new one and I returned that:

return new StaticLink(link.getURL()+"&par1=value1&par2=value2");

To read those parameters in the page java class I have added to the page
declaration the impementation of PageBeginRenderListener interface and
then I have implemented its pageBeginRender method as follows:

    public void pageBeginRender(PageEvent event) {
               
       String parameter1= this.getRequestCycle().getParameter("par1"),
       String parameter2= this.getRequestCycle().getParameter("par2"),
      
    }

Hope someone can find this helpful.

Thanks again to the list for all the help it provides.

-- 
==================================================
dott. Ivano Mario Luberti
Archimede Informatica societa' cooperativa a r. l.
Sede Operativa
Via Gereschi 36 - 56126- Pisa
tel.: +39-050- 580959
tel/fax: +39-050-9711344
web: www.archicoop.it
==================================================



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

Reply via email to