how to maintain sessions in jsp?can you tellme the methods.
Answer Posted / tarak
In the state page u have to set the session
<% Session ses=request.getSession(true);%>
Then set an atribute for the session.
<% ses.setAttribute("attribute","valid session");%>
Session: <% =ses.getAttribute("attribute");%>
(It will display Session: valid session)
Before you close or logout invlidate the session and remove
attribute
<% ses.removeAttribute("attribute");
ses.invalidate();%>
Everytime at the start of page we can check for the value
of sesion attribute. If it is set, then the session will be
valid. Otherwise invalid session.
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What information is needed to create a tcp socket?
What does jsp mean in text?
What are the different types of jstl tags?
What is a page directive?
How are jsp(java server pages) better than asp(active server pages)?
What is the requirement of a tag library?
What is the jsp?
What is jsp api?
What is jsp life cycle?
How to send data from jsp to jsp?
Explain the difference between include directive and include action in jsp?
What is difference between javascript and jsp?
in jsf page i use two dropdown list.i.e state & district.if state dropdown is selected then & then district is enable.what should be my code.
Explain how you understand the action tag and jsp action elements.
How to include static files in a JSP page?