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 ?    12 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are advantages of jsp over asp, php, pure servlets and others?

479


What is the include directive?

531


What are the different scope values for the tag?

471


Can you disable the caching on the back button of a particular browser?

504


What is the purpose of ?

502






How do I prevent the output of my jsp or servlet pages from being cached by the browser?

519


Is jsp technology extensible?

653


Give the use of exception object.

491


Is jsp compiled?

505


What is the purpose of jsp?

534


What is the need of jsp?

500


Why do we need custom tags in jsp?

482


What are the steps involved in reading data from a form using jsp?

712


What is a page directive?

503


What is the difference between servletcontext and pagecontext?

532