Results 1 to 2 of 2

Thread: Pass HTTP Request object between JSP Pages?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 1999
    Location
    Sunny Southern Weather
    Posts
    406

    Question Pass HTTP Request object between JSP Pages?

    I have a servlet which returns a bunch of html code to a jsp page.

    I have since needed to modify the receiving page so that it uses frames.

    I'd like to know how I can pass the Request object from the main page (Frameset) to the final page.

    For example:
    The servlet does this after creating the message string <msg>:

    Code:
    request.setAttribute("wmessage",msg);
    RequestDispatcher dispatcher=getServletContext().getRequestDispatcher("results.jsp");
    dispatcher.forward(request, response);
    My current "results" page uses this code to get the
    request:

    Code:
    <table border="0" cellspacing="2" cellpadding="3" align="left" width="100%">
        <%=request.getAttribute("wmessage")%>
    </table>
    The results.jsp page is now within a frame, and the Frameset Page is called by the servlet.
    I tried this from the Frameset page:

    Code:
    <frame src="results.jsp?results=<%=request%>">
    And this on the Results.jsp page:

    Code:
    <table border="0" cellspacing="2" cellpadding="3" align="left" width="100%">
        <%=request.getAttribute("wmessage")%>
    </table>
    All I ever get is 'null'.

    How can I take the original HTTP Request and send it to the frame page, then retrieve the info I need from the request?

    Thanks.

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Well, if you give "results" as parameter, of course "wmessage" will be NULL...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

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



Click Here to Expand Forum to Full Width