You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Donald Dwoske <dd...@genomecorp.com> on 2002/11/12 19:27:02 UTC

confirmation page best practice

I have been wondering how people present action
results to users upon success.  I'm sure this has been asked before,
but I scanned the archive and didn't find a consensus.

In some cases I use specialized result beans like so:

    // In action after processing
    ResultBean result = new ResultBean();

    // ...

    request.setAttribute("RESULT",result);

    // on page..
    <bean:write name="RESULT" property=" ... />

However, in other cases, all I need is still inside
the form bean, so I don't remove the ActionForm from
scope at the end of my action processing and then
use it in the confirmation page.

    <bean write name="myActionForm" property="..." />

And then remove the bean from scope at the end of the
page, or if I know it's in request scope, just let it
go out of scope.
   <%  session.removeAttribute( "myActionForm" ); %>


In this second way, the pages "know" what the name of the
form bean is, and also what scope it is in... this seems
worse than #1, but more handy.

Does anyone have suggestions of a good way to do this?  What are
you others doing?

Cheers,
  Don


------------------------------------------------------------------------------------------------------
Don Dwoske                                                          mailto:ddwoske@genomecorp.com
"The clearest way into the Universe is through a forest wilderness" - John Muir


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>