简述什么是servlet
3 回答

慕斯709654
TA贡献1840条经验 获得超5个赞
1、编写classHelloextendsHttpServlet{publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse){//PrintWriterout=response.getWriter();out.println("你好,世界!");}}2、编译、调试javac-classpathc:\tomcat6\lib\servlet-api.jar-dWEB-INF\classessrc\Hello.java3、配置web.xmlHelloHelloHello/hello4、使用,或者地址栏直接访问http../firstWeb/hello
添加回答
举报
0/150
提交
取消