Discussion Locked

Building frames with servlets

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm building a web application and I need to figue out how to create dinamically a HTML page, say with two frames.
The content of both frames is dependent of the user profile so they have to be build dinamically.
Any suggestions?
Thanks.

3 replies

by jay eckles

The first call to one servlet will create the frameset page and the src of the individual frames will be either to that servlet again with a parameter to indicate that this is the call to create the frame contents or to a separate servlet:

There's no way for a single call to a servlet to create both the frameset and the frame contents on the fly. This is because the browser will make separate requests for the frameset and each frame, so the servlet has to make multiple reponses. As you know, webservers only deal with one request and make one response at a time.

If you need to pass information from one servlet to another in this process, you've got a couple of options...one is to store the data in a session variable and make the two servlets part of the same application. Another is to pass information on the query string.

Let me know if you need any more help.

Jay Eckles
www.jayeckles.com

This discussion is closed to new replies.