jsp, containers, beans and persistence

Discussion in 'Java' started by milkyway, Dec 14, 2004.

  1. milkyway

    milkyway Guest

    Hello there,

    I have heard that one can set a .jsp page so that the content is valid
    over an entire session. Is this true? Are there any examples where one
    may see this?

    Also, if it is true, then has anyone come across any problems with the
    use of the Tomcat container to pass variables for use from one jsp page
    to another? Are there any limits to what the container can hold - for
    example, if I have 5 jsp pages:


    and I use a setName for first.jsp, can use a getName on fifth.jsp
    (assuming that the variable is in the cloud called "the container"

    I hope I am making sense ;-)

    Kindest Regards.
    milkyway, Dec 14, 2004
    1. Advertisements

  2. Hi,
    I don't know if I really understand your point, but I think you're
    refering to the 'scope' of a variable. A web container has three
    different scopes: request, session an application.
    Request is only present during the processing of a single request.
    Session parameters are available during the lifetime and in the context
    of the session, and application parameters are valid, and shared over
    multiple sessions within the context of the application.
    In your jsp you can use request.getParameter("name"),
    session.getParameter("name") and application.getParameter("name").

    Rogier Spaans
    Rogier R. Spaans, Dec 14, 2004
    1. Advertisements

  3. milkyway

    milkyway Guest


    Thank you for the information. This clears up quite a bit for me ;-)
    Kind Regards.
    milkyway, Dec 16, 2004
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.