To all: I have a web project using FrameSet. If an error occurs I want it to go to an error page (error.jsp). When an error does occur it does show the error page correctly. However, since I use FrameSets, the error page is posted on a targeted frame and not on the entire web page. Is there a way to make the browser post the error page in the whole browser? In my servlet I tried reponse.sendRedirect() and forward(). I also tried creating another servlet for the error page and calling the servlet. None of it worked. Thanks in advance for any help you can give me.
That's because the server-side code is completely clueless regarding the client-side windowing structure. Once a request is targetted to a specific window/frame/iframe there's not a thing you can do on the server to change where the response will be sent.
This is one of the reasons that framesets are universally loathed by web app authors. I never use them.
However, I do use iframes which exhibit the same behavior, so I need to deal with the situation as described above. [ October 19, 2004: Message edited by: Bear Bibeault ]
Thank you. The FrameBuster script worked. I modified it a little so I can pass arguments. Within my error.jsp code I put the frame buster script: <% String lsapplication = (String)session.getAttribute("appname"); String lsErrMsg = (String)session.getAttribute("ErrMsg"); String lspreviouspage = (String)session.getAttribute("currentPage"); %>
---bunch of other error.jsp code --- <% lsapplication = request.getParameter("appname"); lsErrMsg = request.getParameter("ErrMsg"); lspreviouspage = request.getParameter("currentPage"); %>
This way I can get the application name the previous page so I can put a button to go back to the previous application. For some reason I could not get the ErrMsg to come out. But I think that's relatively easy to fix.