论坛首页 海阔天空论坛

HttpServletRequest request 相关方法 得到路径

浏览 3307 次
精华帖 (0) :: 良好帖 (0) :: 灌水帖 (0) :: 隐藏帖 (23)
作者 正文
   发表时间:2011-09-02  
//--------------------------POST---------------
username=qqqq
password=wwww
email=1063128263@qq.com

http://192.168.1.211:8080/demo/index.jsp
------------------------------------------------>
request.getContextPath()	=/demo
request.getMethod()	=POST
request.getRequestURI()	=/demo/reg
request.getRequestURL()	=http://192.168.1.211:8080/demo/reg
request.getServletPath()	=/reg
//-----------------------GET------------------->
http://192.168.1.211:8080/demo/index.jsp?username=1&password=1&email=1
request.getContextPath()	=/demo
request.getMethod()	=GET
request.getQueryString()	=username=1&password=1&email=1
request.getRequestURI()	=/demo/index.jsp
request.getRequestURL()	=http://192.168.1.211:8080/demo/index.jsp
request.getServletPath()	=/index.jsp
 
论坛首页 海阔天空版

跳转论坛:
Global site tag (gtag.js) - Google Analytics