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 do you mean by custom tag in jsp?

511


What are stored procedures? How is it useful?

508


Which package does jsp api consist of?

571


What is translation phase?

573


What is difference between sendredirect and forward?

468






Why is it not recommended to use script elements in jsp?

479


What is cookies in jsp?

494


Tell us about the stages (phases) of the jsp life cycle.

496


What is the difference between directive include and jsp include?

517


What is the include directive?

531


What program opens a jsp file?

494


How we can include the result of another page in jsp?

506


What is a translation unit?

501


Why don’t we need to configure jsp standard tags in web.xml?

510


What is jsp and its features?

535