Solved

URGENT: Spring mvc: create a session

Posted on 2009-05-18
2
1,902 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Which is the latest version of Apache Tomcatl 3 50
bitbucket vs gitbucket 3 57
java 8 lambda expresssions exception handling 3 75
more than one jdk and one jre 1 32
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now