|
这个是文件清单,我已经把它执行成.class的文件了,怎么让它在浏览器里输出,是不是有好几种执行方法,好像不是像JSP文件那样子执行啊?
[code:1]
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet
{
public void doGet(HttpServletRequest request,HttpServletResponse
response) throws IOException,ServletException
{
response.setContentType("text/html");
PrintWriter out=response.getWriter();
out.println("<html>");
out.println("<body bgcolor=\"white\">");
out.println("<head>");
out.println("<TITLE>"+"JSP精彩实例二"+"</TITLE>");
out.println("</head>");
out.println("<body>");
out.println("<div algin=\"Center\">");
out.println("<p>&nbsp</p>");
out.println("<p>&nbsp</p>");
out.println("<p><font size=\"+4\">"+"HelloWorld!"+"</font></p>");
out.println("</div>");
out.println("</body>");
out.println("</html>");
}
}
[/code:1]
刚入门,请各位大虾帮忙!!
我的机器配置如下: jsdk1.4.2+Tomcat4.1 |
|