jsp页面中打印出用,能取得的各种路径

在registerNetinfo.jsp页面中输入这些东东:

  1. <%=" ContextPath:"+request.getContextPath() %>  
  2. <%=" RequestURI:"+request.getRequestURI() %>  
  3. <%=" PathInfo:"+request.getPathInfo() %>  
  4. <%=" LocalAddr:"+request.getLocalAddr() %>  
  5. <%=" PathTranslated:"+request.getPathTranslated() %>  
  6. <%=" QueryString:"+request.getQueryString() %>  
  7. <%=" ServletPath:"+request.getServletPath() %>  

输出结果

ContextPath:/superman

RequestURI:/superman/pages/registerNetinfo.jsp

PathInfo:null

LocalAddr:127.0.0.1

PathTranslated:null

QueryString:method=edit&flag=station

ServletPath:/pages/registerNetinfo.jsp

你可能感兴趣的:(jsp)