Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • How to Implement HttpSession Interface ?

    • 0
    • 3
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 433
    Comment on it

    HttpSession Interface helps in  a way to recognise a user across more than one page request. Servlet container uses this interface to create a session between HttpClient and HttpServer.

    This Interface helps servlets to

    • manipulate and view information about session
    • binding information in the form of object with session so that that information can persist across many sites

    We can obtain a HttpSession using getSession() of HttpServletRequest as

    HttpSession session=request.getSession();  

    In order to set attribute with this object by using setAttribute() which takes two argument as

    session.setAttribute("uname",Test);  

    In order to retrieve these value associated with session by using HttpSession using  getAttribute("uname") as

     String n=(String)session.getAttribute("uname");  

    In this way , We can Implement HttpSeesion In Servlet. Thanks for Reading...

    HttpSession

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: