Is it possible to retrieve session object stored by a servlet, in a JSP file? How do I do that?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use EL
${}in JSP to access objects in page, request, session and application scope by their attribute name. You just have to specify the same name as you used in the servlet to store the attribute. For example, when you store anUserobject with the attribute name"user"as followsthen it’s available in the forwarded JSP by the same attribute name as follows
Another example if it has a
nameproperty with a getter:See also: