在J2EE中,Servlet1的代码如下: importjavax.servlet.*; importjavax.servlet.http.*;importjava.io.*; publicclassServlet1extendsHttpServlet{ publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{ response.setContentType("text/html");PrintWriterout=response.getWriter();Stringaa=request.getQueryString();Stringbb=request.getMethod();out.println(aa); out.println(bb);} } 把Servlet1.class文件放在Web服务器适合的目录下,在浏览B器地址栏内输入:http://localhost:8080/servlet/Servlet1?name=jb-aptech&phone=12345678,看到的结果是()。
- Aname=jb-aptech&phone=12345678GET
- Bname=jb-aptech,phone=12345678GET
- Cjb-aptech,12345678POST
- Dname,phoneGET
- E2,POST