Results 1 to 2 of 2
  1. #1
    erakhman is offline Member
    Join Date
    May 2010
    Posts
    14
    Rep Power
    0

    Default session in servlet

    Hi guys, please help me about session in java...

    if i create 2 session in servlet like this :
    Java Code:
    getSession().setAttribute("mySession","myValue1");
    getSession().setAttribute("mySession","myValue2");
    how to call all mySession in jstl or jsp ???

    thanks for your help....

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    6

    Default

    in jsp expression language, this should be accessible as ${mySession}, the session scope will be searched after the pagecontext and request scopes.
    or in older JSP notation

    <% String value = (String)session.getAttribute("mySession")%>
    <%= value %>

Similar Threads

  1. Replies: 1
    Last Post: 04-22-2009, 12:20 AM
  2. Replies: 1
    Last Post: 03-10-2009, 02:12 PM
  3. Replies: 2
    Last Post: 12-23-2008, 07:35 PM
  4. Replies: 1
    Last Post: 12-02-2008, 01:23 AM
  5. Replies: 1
    Last Post: 08-07-2007, 04:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •