wood burning stoves 2.0*
The moose likes Spring and the fly likes Spring MVC @SessionAttributes - lifespan? Documentation about it? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring MVC @SessionAttributes - lifespan? Documentation about it?" Watch "Spring MVC @SessionAttributes - lifespan? Documentation about it?" New topic
Author

Spring MVC @SessionAttributes - lifespan? Documentation about it?

Dejan Mratinkovic
Ranch Hand

Joined: Nov 20, 2008
Posts: 65
Posted the same question on Spring forum, no luck, let's try here.

I am new to Spring MVC.

So far, I have kept session as clean as possible. Spring MVC seems to encourage session usage via @SessionAttributes

But, I couldn't find any docs describing in detail how this annotation actually works. All I have found are posts on forums from people asking similar question.

I got not much information from http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/web/bind/annotation/SessionAttributes.html

What is lifespan of @SessionAttributes?
To me, after couple of tests, it seems like once another controller is started, the one does not have same session attribute like the previous one, all attributes are cleared (only
@SessionAttributes

defined at that class remain in session), regardless of


. For example, user does not go to SAVE option afetr editing object, but goes to another menu option, so


is never called.

Is my observation correct? Is there any official documentation to back it up?

Btw. I am using Spring 3.0.3

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring MVC @SessionAttributes - lifespan? Documentation about it?
 
Similar Threads
How to pre-populate Spring session bean with Spring MVC annotation
Understand regarding REQUIRED and REQUIRES_NEW
struts2 Vs spring mvc
Session Attributes
Learning Spring