Re: how to redirect from one page to another

Anthony Eden <[email protected]> Tue, 01 Jul 2003 11:00:56 -0400
Newsgroups gmane.comp.java.jpublish.devel
Message-ID <[email protected]>
In JPublish 1.x and 2.x there are several ways to do it depending on how 
you want it to appear to the end user. In your action you can either do 
an HTTP direct using:

context.put("redirect", "url")

In this case the URL will be updated in the browser and request 
processing will stop after the current action completes. Alternatively 
you can use the RequestDispatcher forward:

dispatcher = request.getRequestDispatcher("url")
dispatcher.forward(request, response)

In this case request processing will not stop although the result of 
further processing will never return to the browser (since you have 
already moved to another page).

In JPublish 3 I've changed the first method to 
context.setRedirect("url") but otherwise it is the same.

Sincerely,
Anthony Eden

Andreas Kapp wrote:

>Hello,
>
>We are trying to implement a workflow in JPublish. For example, if we have
>a html form with two checkboxes a user submits. The form's  target /test.html. Now, on
>the server side, we want to decide according to the values of the checkboxes whether
>to display (redirect or forward) /test.html or  /test2.html. 
>
>How would you solf this problem?
>
>Thanks for your advice.
>
>Andreas
>
>--
>N¬HS^µéšŠ[)¢{(­ç[ÈZÞzšÞn襴4DìŠ×¬Šw%¹Ø§€6­i©¢»lÊ&™êÜxú+µ©ljwE¢»¦±ªÞjö¢•¦åzz0Å’'–†¶‡ZÉ©Ãz{^®Ú0Å v§\—¢µb²æ¥JÛŠƒDNm§ÿÚ²™ÞµÉbrK«•Ê&þ
>?¦Æ´Ó]4ÓNš½ïÊ·œµ«Z²:×m7Ó_ôÔšnnX¬…ׯzZ)z¹šŠX§‚X¬´šnnX¬…ׯzZ)z¹b²Û,¢êÜyú+éÞ¶m¦Ãÿ–+-²Ê.­ÇŸ¢¸ë?–+-³ùb²Ø§~ã¦æåŠÈ]z÷¥¢—«
>



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01