This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes Multiple Frames Updated by One Servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Multiple Frames Updated by One Servlet?" Watch "Multiple Frames Updated by One Servlet?" New topic
Author

Multiple Frames Updated by One Servlet?

Chentzen
Greenhorn

Joined: Sep 24, 2000
Posts: 4
I have an application in which:
Frame1 issues the request.
Servlet does it's thing.
Frame1,Frame2,Frame3 need to be updated based upon Servlet data.
I don't know how to get multiple frames to be updated by one servlet. Any ideas will be helpful I'm at a loss right now.
Thanks in advance.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
Here is a note on that which I clipped from the comp.lang.java.programmers newsgroup. It was originally written by Phil Hanna.
"Yes, it works. <FRAME SRC="/servlet/MyServlet"> will invoke MyServlet
at its doGet() method, just as it would if it were in a hyperlink that
was clicked, like <A HREF="/servlet/MyServlet">click here</A>. If the
servlet is not already loaded, the init() method is called first - no
different than any other servlet invocation.
A neat trick is to have the *same* servlet generate the <FRAMESET> and
each of the frames:
<FRAMESET>
<FRAME SRC="/servlet/MyServlet?frame=1" NAME=... >
<FRAME SRC="/servlet/MyServlet?frame=2" NAME=... >
...
</FRAMESET>
Check the "frame" parameter at the top of the doGet() method. If it is
null, generate the <FRAMESET> block, otherwise, generate frame 1, 2, or
whatever.
--- endquote
Chentzen
Greenhorn

Joined: Sep 24, 2000
Posts: 4
Thanks a lot I came to the same conclusion.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple Frames Updated by One Servlet?