[Hippo-cms7-user] Maintain state between doAction and doRender

Mansour Al Akeel mansour.alakeel at gmail.com
Sat May 29 07:14:44 CEST 2010


Woonsan:
thank you. That's exactely what I am looking for. I modified my code and
it's working fine.

On Tue May 25,2010 09:11 am, Woonsan Ko wrote:
> Hi Mansour,
> 
> On Sun, May 23, 2010 at 3:26 PM, Mansour Al Akeel
> <mansour.alakeel at gmail.com> wrote:
> > Hello all:
> >
> > I am looking for some help and advice about the best way to perform
> > communication and maintain state between calls to doAction and doRender.
> >
> > Normally after I process some action, I need to display a message to the
> > user, indicating the results of the action. If I want to use
> > HSTRequest.setAttribute, then It wont work from doAction, since it's
> > meant for processing the request. Therefore, I have to set the request
> > attributes from within doRender method. The easiest way to achieve this
> > is to have a global variable in the HSTComponent and set it's value when
> > processing the action (doAction).
> >
> > This is very similar to portlets, however, when working with portlets
> > ActionRequest, has a method to set Render Parameters. I think this is
> > very clean way to store the action results. Using global variables would
> > do the job with no problem, but I try to avoid using global variable to
> > things clean and easy to test.
> HST-2 also provides setting render parameter in action phase.
> You can use org.hippoecm.hst.core.component.HstResponse#setRenderParameter(key,
> value) in doAction() method. Of course, you can retrieve the parameter
> by HstRequest.getParameter(key) in doBeforeRender() or your render
> page.
> 
> >
> > Any comments ? Is there an example in the demosuite related to this ?
> There's an example in demosuite: org.hippoecm.hst.demo.components.Search
> 
> Regards,
> 
> Woonsan
> 
> 
> >
> > Thank you in advance.
> >
> > _______________________________________________
> > Hippo-cms7-user mailing list and forums
> > http://www.onehippo.org/cms7/support/forums.html
> >
> 
> 
> 
> -- 
> w.ko at onehippo.com     www.onehippo.com
> EUROPE ? AMSTERDAM - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466
> NORTH AMERICA ? SAN FRANCISCO - Hippo USA Inc. 185 H Street, Suite B
> Petaluma CA 94952 +1 (877) 414-4776
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html



More information about the Hippo-cms7-user mailing list