HttpServletRequest

example:http://localhost:8080/test/testRequest?a=a&b=b

 

System.out.println(req.getRequestURI());
System.out.println(req.getQueryString());
System.out.println(req.getServletPath());
System.out.println(req.getContextPath());
System.out.println(req.getMethod());

result:

 

/test/testRequest
a=a&b=b
/testRequest
/test
GET
 

 

 

 

 

你可能感兴趣的:(HttpServletRequest)