Solved

URGENT: Spring mvc: create a session

Posted on 2009-05-18
2
1,907 Views
Last Modified: 2013-11-11

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
Comment
Question by:nick0306
2 Comments
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 24417515
HttpSession session = request.getSession(true);
session.setAttribute("userId",userId);

0
 

Author Comment

by:nick0306
ID: 24419485
thnx
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
numbers ascending pyramid 101 196
Java SE 8u111  Lot of stuff broke 11 69
maven module vs maven project 3 23
String array comparison 4 34
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question