• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1924
  • Last Modified:

URGENT: Spring mvc: create a session


Hi,
i have a simple web application using Spring mvc and spring framework and everything is working just fine. I would like in the controller of the first page (login page), when a user successfully logs in to create a session in the onSubmit method, and pass a parameter (the user id) in that session. All of the following pages should be able to get that parameter user id to use it. How can i create that session?
Thank you
0
nick0306
Asked:
nick0306
1 Solution
 
objectsCommented:
HttpSession session = request.getSession(true);
session.setAttribute("userId",userId);

0
 
nick0306Author Commented:
thnx
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now