Hi Bobo !
This problem comes again and again. It takes multiple aspects, but it i
always the same. To find the solution, do the following :
- call you servlet from you browser.
- display the HTML source code.
- look at this code as if it were static code to find what is going wrong.
- once you can figure the necessary changes in the HTML code, make the
correponding changes in your servlet.
In your specific case, the generated HTML code is :
<html><head><meta name="GENERATOR" content="Microsoft FrontPage 4.0"><meta
name="ProgId" content="FrontPage.Editor.Document"><title>ISSUE LOG
SYSTEM-Administrator</title> <body background="bg.jpg"> </head>
<frameset framespacing="0" border="0" rows="50%,*" frameborder="0">
<frame name="top" src="http://localhost/servlet/AdministratorGate"
scrolling="auto" noresize>
<frame name="bottom" src="http://localhost/blank.html" scrolling="auto"
noresize>
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</html>
The most likely answer is that you are using a wrong url for your "top"
frame. Try to call http://localhost/servlet/AdministratorGate directly and
see what happened.
(You might have forgotten the port number, or the AdministratorGate servlet
is not installed, or anything else !)
Pierre-Yves
-----Message d'origine-----
De : A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]De la part de
Mamadou Bobo Sylla
Envoy� : mercredi 30 mai 2001 04:28
� : [EMAIL PROTECTED]
Objet : Servlet and html Frame
Hello to everyone,
I am tryng to ouput a frame page through the following code of servlet.
I can run and compile it without any error but I receive a blank page when I
call the servlet.
Can anyone tell me what is wrong with this code or How would output a frame
page through a servlet.
Thank you.
Bobo.
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class AdminMainPage extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException
{
PrintWriter out = res.getWriter();
res.setContentType("text/html");
out.println( "<html>"+ "<head>"+
"<meta name=\"GENERATOR\" content=\"Microsoft FrontPage 4.0\">" +
"<meta name=\"ProgId\" content=\"FrontPage.Editor.Document\">" +
"<title>ISSUE LOG SYSTEM-Administrator</title>" + " <body
background=\"bg.jpg\"> " +
"</head>" );
out.println( " <frameset framespacing=\"0\" border=\"0\"
rows="+"\"50%"+","+"*"+"\" frameborder=\"0\"> ");
out.println( " <frame name=\"top\"
src=\"http://localhost/servlet/AdministratorGate\" scrolling=\"auto\"
noresize> ");
out.println(" <frame name=\"bottom\" src=\"http://localhost/blank.html\"
scrolling=\"auto\" noresize> ");
out.println("<noframes>");
out.println("<body>");
out.println("<p>This page uses frames, but your browser doesn't support
them.</p>");
out.println("</body>");
out.println(" </noframes>");
out.println("</frameset>");
out.println("</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
___________________________________________________________________________
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