How to display variable

Discussion in 'Java' started by sanghani.bhavin@gmail.com, Nov 22, 2005.

  1. Guest

    I am new to JSP and i wanted to display session attributes onto the
    HTML PAGE
    same page. How do i write the syntax and where to i write it.
     
    , Nov 22, 2005
    #1
    1. Advertising

  2. Markus Guest

    Try this on your JSP:
    ....
    <%
    out.println(session.getAttribute("yourAttributeName");
    %>
    ....

    With sesion.getAttributeNames() you will get an Enumeration of all
    AttributeNames.

    Kind regards

    Markus
     
    Markus, Nov 22, 2005
    #2
    1. Advertising

  3. VisionSet Guest

    <> wrote in message
    news:...
    > I am new to JSP and i wanted to display session attributes onto the
    > HTML PAGE
    > same page. How do i write the syntax and where to i write it.


    Or in JSTL

    ${sessionScope.mySessionAttribute}

    or just

    ${mySessionAttribute}

    Tomcat needs the JSTL jar on its classpath.
    The JSTL library is available from Apache/Jakarta.

    --
    Mike W
     
    VisionSet, Nov 22, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Imran Aziz
    Replies:
    4
    Views:
    1,529
    Imran Aziz
    Aug 11, 2005
  2. Marc Twain

    Display and display model

    Marc Twain, Jan 13, 2004, in forum: Java
    Replies:
    1
    Views:
    388
    Matt Humphrey
    Jan 13, 2004
  3. SG
    Replies:
    6
    Views:
    30,619
    ricuzzo
    Jan 15, 2008
  4. mfglinux
    Replies:
    11
    Views:
    727
    Roberto Bonvallet
    Sep 12, 2007
  5. David Filmer
    Replies:
    19
    Views:
    260
    Kevin Collins
    May 21, 2004
Loading...

Share This Page