[
http://www.stripesframework.org/jira/browse/STS-429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11282#action_11282
]
Christian Poitras commented on STS-429:
---------------------------------------
After this discussion, I decided 3 things.
1) The serializable will be true by default. When true, I use Vadim's
suggestion. Therefore, the result code is.
if (object == null) {
// If object is null, remove attribute.
Object ret = session.getAttribute(key);
session.removeAttribute(key);
return ret;
}
else if (serializable && object instanceof Serializable) {
Object ret = session.getAttribute(key);
session.setAttribute(key, new MaxTimeSaver(object, maxTime));
return ret;
}
else {
Object ret = session.getAttribute(key);
session.setAttribute(key, new NoSerializeSaver(object, maxTime));
return ret;
}
2) There won't be any remove attribute. It's already easy to remove fields and
it's documented on Stripes web page. It's a simple matter of affecting null to
field.
public Resolution cancel() {
myField = null;
}
3) I won't add a TimeUnit attribute. John's suggestion is interesting, but Java
5 don't support TimeUnit.MINUTES (the support is up to TimeUnit.SECONDS only).
I'll be glad to add this attribute when Stripes won't support Java 5 anymore.
> @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