File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

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

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

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

I agree. Here's the link:
subject: Spring MVC @SessionAttributes - lifespan? Documentation about it?
It's not a secret anymore!