we have done something of that kind through changing the target="_top" in
the HTML which ask user to enter the loginid and password.
and if you want it to be done in the servlet code than may be you can write
a small java script into   out      as
out.println(" <script>        top.location='/text/app/home.html' </script>"
); after validation.

i'm still looking for some better ways of changing the target dynamically
inside the servlets code.

cheers,
Rahul









patrick lurlay <[EMAIL PROTECTED]> on 10/05/99 09:19:45 AM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:    (bcc: Rahul Dwivedi/LTITLVSH)

Subject:  Servlet Redirect question




Question everyone!!!!!!
              Quick background and then the question.  I am doing a
redirect to an html page(index.html) after a username and login has been
validated.  The redirect works fine except that the new page is being
displayed in the middle frame of the index.html.  Is there a way that I
can, in my servlet code, dispose of the index.html file and have only
the file(home.html frame) I am redirecting be the one displayed?  Please
see code below.

Cheers

Pat


//imports java servlet libraries

        doPost(req,res);

           {
         out.println("<HTML><HEAD><TITLE>Access Denied</TITLE></HEAD>");

         out.println("<BODY>Your login and password are invalid.<BR>");
         out.println("You may want to
<A>HREF=http://barney:8080/index.html>try again</A>");
         out.println("</BODY></HTML>");
      }
       else if ( !req.getParameter("username").equals("") &&
                 !req.getParameter("userpasswd").equals(""))
       {
                boolean isValidUser = validateUser(Uname,Upasswd);
                if ( isValidUser ) {
                    //IT IS A SUCCESS DO THE REDIRECT HERE....

res.sendRedirect("http://barney:8080/text/app/home.html");
                }
                else
                {
                   //FAILED RETURN MESSAGE TO USER
                    out.println("<p> User Validation Failed for User: "
+ Uname);                                }
                }

 }

___________________________________________________________________________
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

Reply via email to