当前位置: 技术问答>java相关
servlet程序如何运行啊???
来源: 互联网 发布时间:2017-05-02
本文导语: 刚学习java package kking; import javax.servlet.*; import java.io.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException { r...
刚学习java
package kking;
import javax.servlet.*;
import java.io.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest req,HttpServletResponse res)
throws ServletException,IOException
{
res.setContentType("text/html");
PrintWriter out=res.getWriter();
out.println("");
out.println("");
out.println("Hello World Sample Servlet");
out.println("");
out.println("");
out.println(",Hello World!");
out.println("/BODY");
out.println("/HTML");
out.close();
}
}
这样的servlet程序如何运行啊???
package kking;
import javax.servlet.*;
import java.io.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest req,HttpServletResponse res)
throws ServletException,IOException
{
res.setContentType("text/html");
PrintWriter out=res.getWriter();
out.println("");
out.println("");
out.println("Hello World Sample Servlet");
out.println("");
out.println("");
out.println(",Hello World!");
out.println("/BODY");
out.println("/HTML");
out.close();
}
}
这样的servlet程序如何运行啊???
|
http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=23660
http://expert.csdn.net/Expert/FAQ/List_Room_FAQ_Index.asp?Roomid=5409
http://expert.csdn.net/Expert/FAQ/List_Room_FAQ_Index.asp?Roomid=5409
|
笼统说:
首先编译通过,放在设置的目录中
在IE中输入地址就可以
首先编译通过,放在设置的目录中
在IE中输入地址就可以
|
找一个servlet engine如tomcat,接下来如楼上的人说的做。