how to maintain sessions in jsp?can you tellme the methods.

Answer Posted / brindha.d

using session oject in jsp.
first u set using following methods
String name="ravi";
session.setAttribute("user",name);
using retrive method
String sessionuser=session.getAttribute(name);
out.println("welcome"+sessionuser);
u give this last 2 stmts in all jsp pages. it will
display as "Welcome ravi".

Is This Answer Correct ?    121 Yes 55 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you know about jsp expression language (jsp expression language – el)?

519


Define JSP Scriptlet.

561


What is jsp translation phase?

482


How to create menu in jsp with example?

480


How does jsp engines instantiate tag handler classes instances?

477






What is scriptlet and what is expression?

512


What is the difference in using request.getrequestdispatcher() and context.getrequestdispatcher()?

564


How do we configure init params for jsp?

516


How can we forward the request from jsp page to the servlet?

517


What is the purpose of creating custom tags?

527


What does jsp mean in text?

474


What is a declaration statement?

489


Define jsp declaration?

568


Differentiate between and <%@include file=…>.

519


What is jstl?

531