jsp - session - how to incorporate session?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tangara
    New Member
    • Jan 2010
    • 27

    jsp - session - how to incorporate session?

    Hi,

    I would like to know how to make use of session to apply in my jsp pages.

    My login.html page contains the session codes as follows:-

    Code:
    <%@page import="java.util.*"%>
    <String str = request.getParameter("UserID"));
    
    session.setAttribute("UserID", request.getParameter("UserID"));%>
    Welcome to <session.setAttribute("UserID").equals("")){%>
    <ahref ="login.jsp""><b>Login</b></a>
    <%>}
    However, I'm stuck here. I know that there's a session value which is created for that particular user when he/she first logged in. If not, this person will need to do the login and validate against the user name and password before the user can enter another page.

    Now, if this person has login before, I assume that the programme will store the value objects somewhere right? If yes, where is the value objects store?

    When the person go to another page, and since the user has logged in before, so no need to do the re-log in. How do I incorporate the session object in another page so that this person doesnt need to re-login.

    Advice on the above is greatly appreciated.
Working...