[Opensource] Some questions

Michael Rimov rimovm at centercomp.com
Mon Aug 5 22:41:29 PDT 2002


At 04:58 PM 8/1/2002 +0000, you wrote:
>hi,
>
>Actually intended to use Expresso for the MVC, find the state transition 
>conveient than declaring many struts forms.
>
>Have a few questions:
>
>1) How do I make the controller act like Session EJB?

Do you mean by maintaining state between requests?  if so then:


>Do I use HTTPPersistentSession in the controller? How does the object 
>stored in the CacheManager different from those in the Session?

Call ControllerRequest.getSession() within the controller and then set the 
persistant attributes. [Make sure the keys are 'relatively' unique so you 
don't collide with other classes in your webapp]

CacheManager may remove any objects stored in it, or if memory is low, it 
might not even store the object at all.  It simply tries to provide a 
location to reuse objects if memory permits.  But it may always return null 
and clear out the object if memory required it.


>2) If inputs, output and transition are not used, rather I just pass the 
>parameters over thru hidden fields and set the state to be the next state, 
>does this work? And will the expresso controller behaved the same?

It should.  The biggest thing you lose by not doing that is you lose the 
ability to provide more than one get or post transition from the same 
form.  Other than that, it should work great.  I often manipulate URL's to 
directly go to a screen rather than going through HTTP POST myself.

HTH!
                                         -Mike




More information about the Opensource mailing list