I solved it creating a ModelManager, which hold associations between the
session id and a hashtable of session values. This way, there is no
dependence with a servlet implementation of UserSession.
Anyway, I also found that there is no checking of user access to a state
which wasn't visitated... I'm working on this now.
Robson.
----- Original Message -----
From: "Brian O'Byrne" <bo...@io...>
To: <jst...@li...>;
Sent: Sunday, May 19, 2002 5:37 PM
Subject: Re: [JStateMachine-users] Session values
> Robson,
>
> With the current interfaces, it will probably depend on which
> session manager package you are using.
> The org.jstatemachine.sessionmanagers.servlet.UserSession class
> includes the getHttpSession() method, that allows you access the
> HttpSession that is in scope. This in turn gives you the standard
> Servlet API methods to put objects in the session context.
> The org.jstatemachine.sessionmanagers.inmemory.UserSession
> class does not include anything you can use as it stands. It
> would, however, be trivial to extend that class to include the data
> you require.
> You would need to create the new class, and modify the
> UserSessionManager to create your new class.
>
> Alternatively, I could add something to the IUserSession interface,
> such as getProperties / setProperties, and then implement that in
> both the current session manager packages.
>
> Finally, there is a way you could do it with the current framework
> unchanged, though it is a bit of a hack:
> After authentication is complete, add the authentication token to
> the ResponseData. On each subsequent request, call
> getHistoryStar from your Controller, passing in the application root
> state. Retrieve the authentication token and check it. If it passes,
> add it to the new ResponseData and continue. If it fails, the
> Controller can throw a StateMachineUserException, forcing the UI
> into an exception state that is outside the authenticated area of
> your application.
>
> Let me know how it works, and I will look at adding something to
> the IUserSession interface for the next release.
>
> Thanks,
> Brian.
>
> On 18 May 2002, at 11:02, Robson Miranda wrote:
>
> > Hi,
> >
> > I'm beginning to use the JStateMachine framework, and I have one
> > doubt: how can I put some values to be used during all the states
> > visiteds by one user (such as the user identification)?
> >
> > Robson.
> >
> >
>
>
> _______________________________________________________________
> Hundreds of nodes, one monster rendering program.
> Now that's a super model! Visit http://clustering.foundries.sf.net/
>
> _______________________________________________
> JStateMachine-users mailing list
> JSt...@li...
> https://lists.sourceforge.net/lists/listinfo/jstatemachine-users
>
>
|