SessionAttribute « Session « Spring Q&A

1. SessionAttribute and SpringFramework

How can I set session attribute using spring framework and annotation? Something equivalent to

 request.getSession().setAttribute("key", "value");

2. Spring - SessionAttribute problem

I want to implement something like this:

class PromotionController {
    void showPromotionInfo(
        @RequestParam("promId") String promotionId,

3. using sessionAttribute in annotated controller spring MVC

class something
Now i know that @Controller = implements Controller
@requestMaping =   <bean name="/user.html"
now i don't know which thing is equal to @sessionAttributes("user"); if i don't use annotation

4. Spring MVC - Variables between pages, and Unsetting a SessionAttribute

The question sounds weird, I'm playing around with Spring MVC and am trying to move between two pages and basically I'm creating a JSP page using Spring Form JSTL's so it ...

5. @sessionattribute and session timeout

Hi, I was wondering how I can catch session timeout on controllers that use @sessionattribute? In my app, page errors out if session is timed out. Basically, I want to redirect ...

6. Problem with @SessionAttribute and SessionStatus

Hi All, Currently we are using @SessionAttributes. In post request method, we are having status.setComplete. If i print the model value after status.setComplete, it is still holding the value. Can anyone ...

7. @SessionAttribute problems

@SessionAttribute problems I'm trying to store a variable in the session using the @SessionAttribute variable but I think I'm doing something wrong. The first class is the controller that is executed ...

8. Redirect making @SessionAttribute lost?

Redirect making @SessionAttribute lost? In brief, I found that if I do a redirect, the @SessionAttribute will be lost. So I think I might be doing something wrong? Detail: I'm making ...

9. @SessionAttribute only works with @ModelAttribute, not with ModelMap

Spring doesn't populate the implicit model (ModelMap parameter) of POST method handler with the model attribute value added in the first call (GET). Code: @Controller @RequestMapping("/...") @SessionAttributes("attrName") public class TestController { ...

10. Need clarification on @SessionAttribute

Hello, I'm using @SessionAttribute in conjunction with @ModelAttribute on a method. I thought that the method should be called only once. But it looks like it is called for each HTTP ...

11. Persist a object sessioned with @SessionAttribute

12. @SessionAttribute implementation ??

13. Problem with SessionAttribute

Problem with SessionAttribute Folks, I'm pretty new to Spring and completely new to the forum, I'm having some trouble understanding exactly what is going wrong on a page I've been working ...