3、法二:部署目录:部署在../webapper/aaaa/访问方法:在URL屮直接输入路径和类文件名称,即http://127.0.0.l:8080/aaaa/servlet3.方法三:部署目录:部署在../webapper/aaaa/利用web.xml文件的设置访问资源的技术方法,即加入代码:ServletTestpachage_name.Servlet_c1ass_name
4、servlet>ServletTest〈/servlet-name>/testing
5、licclassMy_servletextendsHttpServlet{publicvoidinit(ServletConfigconfig)throwsServletException{super,init(config);}publicvoidservice(HttpServletRequestreqest,HttpServletResponseresponse)throwsIOException{methodentity);}}(B)工程方法publicclassMy_servletextendsHttpS
6、ervlet{publicvoidinit(ServletConfigconfig)throwsServletException{super.init(config);}publicvoiddoGet(HttpServletRequestreqest,HttpServletResponseresponse)throwsIOException{methodentity);}publicvoiddoPost(HttpServletRequestreqest,HttpServletResponseresponse)thr
7、owsIOExceptiondoGet(.・));}}2.利用JSP访问servlet文件的基本方法<%©pagecontentType二"text/html;charset=GB2312"%>