Hi, I have a html called defaultFrame.htm that generates three frames calling topnav.htm(topframe) and leftnav.htm(leftframe) and a servlet(mainframe). I want that whenever an exception occurs in servlet the response is an error page but in one frame only, the topnav and leftnav frames should not be visible or generated. My question is: 1. Is there a way to specify target in servlets? if so then how? 2. Is there any other way of achieving this when an exception occurs in servlet. Thanks in advance.
"When work, commitment and pleasure all become one and you reach that deep well where passion lives, nothing is impossible."
1. The "target" can only be determined on the browser side with your HTML. 2. Right off-hand, I can't see how you would accomplish this with your present frame definition since each frame is filled by a separate request. If you create the frameset with a servlet, then you could control whether or not the navigation frames are displayed. Bill
I achieved something similar using a modal dialog to call my servlet and sending the window object to the modal dialog. OnLoad of the modal dialog, the window object can be accessed using window.dialogArguments and each frame can be updated using DIV objects and/or innerHTML. Finally, you can close the modal dialog. The dialog box flickers on the screen for a millisecond but it surely works. I believe you could do the same using a hidden frame as well instead of a modal dialog. As Bear correctly suggested, Hidden fields would help as well. Please refer to the msdn site and search on showmodalDialog. This is slightly tricky but it works. I hope this helps... Thanks, Maneesh
Sun Certified Java Programmer 2 (1.4)<br />Sun Certified Web Component Developer
Joined: Aug 08, 2003
Thanks Manish, Bear and William for your precious help... I used your suggestions and a little bit trial and error and found a solution to my problem... I am posting sample code for anyone who may have a similar problem...
By writing the above html to the browser from my servlet i was able to kill the frames and display the login.htm file. PS: The "on load" attribute in body tag should be without space. The javaranch didnt allow to submit me the reply with without space. Cheers!! [ September 11, 2003: Message edited by: Tejpal Singh ]