Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Mention some important jsp action tags.

903


What is translation phase?

981


What is cookie with example?

860


Is jsp front end or backend?

848


Can we define a class in a jsp page?

850


What is an api with example?

958


How to find out the name of the http method using jsp el?

913


What is action tag in jsp?

846


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

827


How can we extend jsp technology?

1016


Why should we not configure jsp standard tags in web.xml?

852


how can i add properties in dynamic text fields using .js file?

2233


What is cookies in jsp?

834


How do I perform browser redirection from a jsp page?

841


Explain jsp action elements or action tags?

881