Hi there,
The @Session annotation is pretty cool, and inline with the Stripes
spirit ! Nice stuff, for those using the HttpSession ;-P
Now, just to make tings clear, this is not a real alternative for
ActionBeanContext overriding...
When you add methods to your own subclass of ActionBeanContext, you
actually add an indirection level, and therefore you can switch very
easily to session-less implementation later on, with 0 impact on your
actions (e.g. getUser() looking for a cookie and hydrating the
appropriate object from a database instead of retrieving from
session).
My 0.02€
Cheers
Remi
On 11/6/07, Jasper Fontaine <[EMAIL PROTECTED]> wrote:
> Poitras Christian wrote:
> > That's what I like about open source! Suggestions like this one is very
> > interesting to add.
> > It wouldn't be difficult to add a fieldKey (or key) attribute to annotation
> > thus enabling sharing of a field between actionbeans.
> >
> > Example :
> > public class ActionBean1 {
> > @Session(key="myAttrib") private myAttrib;
> > }
> > public class ActionBean2 {
> > @Session(key="myAttrib") private myAttrib;
> > }
> >
> > When ActionBean1 saves field in session, ActionBean2 will get the value on
> > later requests.
> >
> > For sure, this will need care when programming actionbeans, but is a very
> > good add-on.
>
> checking for duplicate keys could be done at startup of course, just
> like for example stripernate where it searches for classes with the
> @Entity annotation, but this might get a bit too heavy?
> just a thought..
>
> It would be very nice, just having something like
>
> @Session(key="authenticatedUser")
> User user;
>
> to be able to access the logged in user very easily. A bit of DI, sort of ;)
>
> Of course a getUser method on the context would also do the trick, but i
> like the annotation.
>
> -j
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Stripes-development mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-development
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development