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

Explain the action?

594


Is jsp static or dynamic?

495


Is jsp used?

494


What is the difference between jsp and php?

487


What is jsp taglib?

517






What are directives in jsp?

505


How jsp is executed?

467


How do I use a scriptlet to initialize a newly instantiated bean?

554


What is page scope?

495


How is scripting disabled?

530


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

531


How to run java program in jsp page?

518


Why is jsp used for?

507


Mention some important jsp action tags.

520


What are the components that make up a tag library in jsp?

452