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

Why is jstl used?

506


What are the different types of directives available in jsp?

514


What are jsp and servlets?

481


Why do we need custom tags?

497


What are the benefits of pagecontext implicit object?

767






Is jsp page extensible true false?

496


How can I extend the functionality of jsp?

507


How to retrieve warnings?

520


What is the purpose of ?

504


What is jsp translation phase?

482


Which one is better jsp or servlet?

471


Why jsp is better over static html also explain lifecycle of a jsp?

448


What is jsp net?

516


What are the events in jsp page?

486


How do you connect to the database from jsp?

543