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

Java Server Page I can use a function in two ways: Either I declare or I declare <%@ page import = "mypack.mysubpack.MyClass" %> In each case I can call a function later by coding MyClass.myFunction(); So what is the difference between the two variantes? Why are Beans invented if we don't need them because we have the import statement ? please guide me its an humble request to you reader if u know n i'll be thankful to you...........

1697


What is jstl?

538


What happens when a page is statically included in another jsp page?

563


What is the use of requestdispatcher?

531


What is the purpose of ?

509






How to connect jsp and java file?

472


Give a sample jsp configuration in the deployment descriptor.

504


Explain JSP Output comments?

568


How can we disable el?

524


What is jsp index?

497


What is tld in jsp?

488


Why is it that JComponent have add() and remove() methods but Component doesn’t?

515


What is jspinit method?

513


Explain translation phase.

506


What are the different scope values for the jsp objects?

510