浏览 3721 次
锁定老帖子 主题:servlet小例子
该帖已经被评为新手帖
|
|
---|---|
作者 | 正文 |
发表时间:2009-02-01
web.xml 中加入 <servlet> <servlet-name>HelloWorld</servlet-name> <servlet-class>com.kong.rd.ivr.memcached.monitor.MemcachedMonitorAction</servlet-class> </servlet> <servlet-mapping> <servlet-name>HelloWorld</servlet-name> <url-pattern>/servlet/*</url-pattern> </servlet-mapping> MemcachedMonitorAction.java import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class MemcachedMonitorAction extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { PrintWriter out = response.getWriter(); out.println("hello world"); } } http://localhost/com.kong.rd.ivr.memcachedload/servlet/HelloWorld 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2009-02-22
恩 基本的例子
|
|
返回顶楼 | |