为什么我一再浏览器中访问就出现这句话呢?
This is class cn.itcast.response.RequestDemo1, using the GET method- package cn.itcast.response;
- 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;
- //request的常用方法
- public class RequestDemo1 extends HttpServlet {
- public void doGet(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- System.out.println(request.getRequestURI());
- System.out.println(request.getRequestURL());
-
- }
- public void doPost(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- doGet(request, response);
- }
- }
复制代码 |