> I have a question about the use of singleton and throwaway controllers. It
> appears to me that one use of singleton controllers would be to maintain
> stateful information across controller invocations.
>
> Would this be an approriate use of these controllers or do you recommend
using
> the standard J2EE practice of HttpSession or a SessionBean?
>

It depends on the behavior you are looking for. While a singleton controller
would maintain state across invocations, that state would not be tied to a
particular user the way session data would be.

So if you want to maintain state that is common to all users (how many times
has this controller been called, or the url of some common resource or
something) then maybe the it would be appropriate. On the other hand, if you
wanted to hold a reference to the currently logged in user, then the session
would be more appropriate.

--jim



-------------------------------------------------------
This SF.net email is sponsored by: Tablet PC.  
Does your code think in ink? You could win a Tablet PC. 
Get a free Tablet PC hat just for playing. What are you waiting for? 
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
[INVALID FOOTER]

Reply via email to