request获得当前浏览器访问全部URL

例如:http://localhost:8080/goods/BookServlet?method=findByCategory&cid=100&pageNow=3
request.getRequestURI(); 得到/goods/BookServlet
request.getQueryString();得到method=findByCategory&cid=100&pageNow=3
request.getServletPath();得到BookServlet
request.getServerName();得到服务器地址
request.getRequestURL();得到http://localhost:8080/goods/BookServlet
request.getHeader("referer");得到http://localhost:8080/goods/CategoryServlet;jsessionid=6E526D759A3C0ACA1B2478F345C7E303?method=findAll
 
  
 
  
 
  
 
  
 
  
 
  
 
 

你可能感兴趣的:(服务器问题)