Redirecting two pages from Servlet to two frames???

Discussions

Web tier: servlets, JSP, Web frameworks: Redirecting two pages from Servlet to two frames???

  1. I need my servlet to redirect two different pages to two different frames. I can do this in html like this

    <FORM>
    <INPUT TYPE="button" Value="Click me"
    onClick="parent.frames[1].location='page1.html';
    parent.frames[2].location='page2.html';">
    </FORM>

    I can do ONE page to go to other frame giving TARGET in FORM tag in JSP.

    How can I do multiple pages from servlet?

    Thank you,

  2. Browser requesting a page and servlet responding it are a request response system. All the servlet can do is respond to a request from the HTML. Even the target (to which frame or to a new window etc.) to which the response should be directed is decided is at the fornt end. You cannot make the servlet send two responses to two different frames.

    What you can do is a work around. When you submit from your HTML and set the target say frame1 return the relevent html to this frame. On load of this frame submit to a servlet and redirect the response to frame2. Similarly you can probably find other workarounds depending on your requirements.