You may want to take a look at the Struts Dialogs:
http://struts.sourceforge.net/strutsdialogs/ It is a new development
within Struts Application project.

It was me who wrote the article on TSS, and I am gradually making
these ideas into usable components. DialogAction is an action which
uses POST-redirect-GET pattern to split input and output into two
separate phases. It uses action form as a temporary buffer for UI
data. It also handles messages for you.

Current version needs Struts 1.2.6+, becuase its clearMessages()
method uses new error-handling method: saveErrors(HttpSession session,
ActionMessages messages). I am going to refactor this code to make it
work with earlier versions of Struts. If you need to work it right
now, just change
  saveErrors(HttpSession session, ActionMessages messages)
simply to
  session.setAttribute(Globals.ERROR_KEY, messages);

You may also find this article interesting:
http://wiki.apache.org/struts/StrutsCatalogInputOutputSeparation

I personally do not like to attach data to redirected request for
several reasons.
* First, this data is not stored on the server. Thus, if you leave the
page and then navigate to it, typing URL in the browser address bar,
you will not see messages.
* Appending data to URL makes URL "dirty" and encourages browser to
build up page history with each request. In DialogAction I tried to
keep URL clean and to avoid increasing page history. This helps in
fighting with stale pages.

Let me know if you have further questions.

Michael.


On 6/12/05, Yuniar Setiawan <[EMAIL PROTECTED]> wrote:
> Hi all,
>  I'm trying to implement the PRG (post-redirect-get) pattern which was
> published in theserverside.
> The magic key is to use redirect="true" in the local forward like this:
>  <forward name="showParentForm" path="/DrawingUpdate.rnd" redirect="true"/>
>  it works very nice, no more double submit problem when user press Back and
> Forward button. But the problem is I lost my ActionMessage after the
> redirect. I need the ActionMessage to display success message. Is there any
> way beside using session to store those message? cause if I have to use
> session then the whole ActionMessage thing in my application will be useless
> :(
>  Thanks for the help
> Best regards.
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to