[ 
http://www.stripesframework.org/jira/browse/STS-429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11295#action_11295
 ] 

Jerrold Poh commented on STS-429:
---------------------------------

I'm not sure if this is the right place to comment, but I think I have found a 
bug / feature request.

Lets say I have a parent class and many child classes.  In the child classes I 
want to define a field to be stored in the session.

Using the @session annotation, currently I have to specify the field in all the 
child classes and annotate all the fields with @session.  

Lets say I want to follow the DRY principal, so I create a field in the parent 
class, then annotate it with @session, and remove the fields in the children.  

Instead of the interceptor storing each of the fields for the child classes in 
the session (what I'd expect to happen), it instead stores just a single field 
from the parent.

I was going through the code and found that in the 
SessionStoreInterceptor.getFieldKey() method it sets the session key as the 
name of the declaring class.  Instead I think it should search for the calling 
class and set the key to include that instead.  

I'm not a big user of reflection so I'm not sure how that would be done 
(otherwise I would have sent you a patch for it).

Oh and good work on this addon.  I've found it (even in its current state) 
infinitely useful.  I'm hoping there are plans to integrate into a future 
version of Stripes.

> @Session annotation to save and restore fields automatically
> ------------------------------------------------------------
>
>                 Key: STS-429
>                 URL: http://www.stripesframework.org/jira/browse/STS-429
>             Project: Stripes
>          Issue Type: New Feature
>            Reporter: Christian Poitras
>            Priority: Minor
>         Attachments: session-plugin.jar, session-plugin2.jar, 
> session-plugin3.jar, session-plugin4.jar, session-plugin5.jar
>
>
> I've added a @Session annotation and an interceptor that automatically saves 
> annotated fields in session and restores the fields on following request.
> This could be a great add-on to Stripes.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to