There are two ways of doing that.
You can specify the target-attribute in the form that calls your
login-servlet just as you do in a normal link.
...<form action="whoKnows" target="_top">...
That would result in every servletresponse replacing your frameset, even
if the authentication fails. I don't know if that is what you want to
do.
The other way is to send an html-page with a JavaScript overwriting the
location of your top-object, like this. We use it because it allows us
to break out of our frameset conditionally.
public void doPost(HttpServletRequest req, HttpServletResponse res){
authenticate
ServletOutputStream out = res.getOutputStream();
if(authentication failed){
res.setContentType("text/html");
out.println("<html><head><title>DumbPage</title></head>");
out.println("<script>");
out.println("top.location.href=\"http://yourserver.com/theframeset.html\
"");
out.println("</script></html>");
}
else{
res.sendRedirect("http://yourserver.com/tryagain.html");
}
}
Hope it works,
/Micael
> -----Ursprungligt meddelande-----
> Fr�n: Dave Scott [SMTP:[EMAIL PROTECTED]]
> Skickat: den 10 augusti 1999 16:36
> Till: [EMAIL PROTECTED]
> �mne: Servlets, SSI and HTML Frames
>
> I'm building a servlet that is initiated from a html page where you
> can
> enter in your user name and password - the servlet then authenticates
> your
> user name and password with a 3rd party application, if authentication
> is
> successful, the servlet then redirects (using the sendRedirect()
> method) the
> browser to a new web page. However, the new web page is also using
> frames,
> and a different frameset from the page where the servlet was initially
> called.
>
> In standard html when you wish to replace one frameset with another
> you
> specify the url and then supply the target="_top" parameter - i.e.
>
> <a href="aaa.html" target="_top">Display Account Summary</a>
>
> The sendRedirect method doesn't support any paramters - only a URL -
> the
> question is how do I get my new frameset to be displayed at the top
> level,
> replacing the current frameset on the browser ?
>
> Can anyone help?
>
> Dave Scott
> Henley Software Consultants
> E-mail: [EMAIL PROTECTED]
>
> ______________________________________________________________________
> _____
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
> http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html