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

Answer Posted / murali mohan rao

first set the value in session using following methods
***Don't create the unnecessary Strings***

<%session.setAttribute("user","Murali");%>

Below statement you can use in any JSP to print the
welcome message. Start using JSP tags to better performance
and better coding.

Welcome to <%=session.getAttribute("user")%>

Is This Answer Correct ?    8 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create menu in jsp with example?

480


What is jsp taglib?

510


What is expression language injection?

496


How is jsp include directive different from jsp include action. ?

534


What is context in web application?

488






Why is jsp used for?

498


How many tags are provided in jstl?

582


What is meant by jsp?

507


What is jsp and its features?

531


What is dynamic web project?

502


What is request scope in jsp?

514


Explain handling of runtime exceptions.

643


How do you delete the session data?

516


How will you use jsp el in order to get the http method name?

503


What is the advantage of using getProperty action, as compared to the accessor method?

2758