Hi Angelo,
I use the sendRedirect, like peter said, instead of throw a
RuntimeException:

response.sendRedirect(request.getContextPath() + "/start");

if you want to execute a method on the page, you should try something like
"/start.init/STRING_VALUE". You must have a init(String arg) waiting on the
start page too.

2007/12/20, Peter Stavrinides <[EMAIL PROTECTED]>:
>
> Hi Angelo,
>
> You already have the request and response object what else would you
> need? the Dispatcher example is great, but a changed a few lines, for
> errors I use: response.sendError(401, "Authentication failed") instead
> of the exception which I feel is not appropriate,for a redirect you
> could use:
> response.sendRedirect(arg0), a redirect should not be used for an error
> though!... nevertheless the browser headers have everything you need...
> look into the Location and Referer headers, I seem to recall the
> Location header is used to retrieve the page you are targeting.
>
> Peter
>
> Angelo Chen wrote:
> > Hi,
> >
> > I'm reading
> > http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher2
> > Tapestry5HowToCreateADispatcher2 , it works, but how to redirect a page
> in
> > the dispatch? here is the code:
> >
> > if(!canAccess) {
> >
> >                         throw new RuntimeException("Access violation!");
> >                 }
> > also, how to determine which page is being requested?
> >
> > Thanks,
> >
> > A.C.
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Atenciosamente,
Marcelo Lotif

Reply via email to