java request获取相关路径

Posted cghhnty

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java request获取相关路径相关的知识,希望对你有一定的参考价值。

Request URL: http://localhost:8080/sanjuSCM/scmTruck/list.do?truckno=%E6%B2%AAF00000&companyid_Display=&companyid=

String u = request.getRequestURI();   /sanjuSCM/scmTruck/list.do

String u2 = request.getContextPath(); /sanjuSCM

String u3 = request.getPathInfo();  null
String u4 = request.getServletPath();  /scmTruck/list.do
String u5 = request.getRequestURL().toString();  http://localhost:8080/sanjuSCM/scmTruck/list.do
String u6 = request.getRequestURL().toString()+"?"+(StringUtils.isBlank(request.getQueryString())?"":request.getQueryString());  http://localhost:8080/sanjuSCM/scmTruck/list.do?truckno=%E6%B2%AAF00000&companyid_Display=&companyid=

 




以上是关于java request获取相关路径的主要内容,如果未能解决你的问题,请参考以下文章

java request获取相关路径

java中怎样获取当前路径的绝对路径

Java web项目访问路径问题。求解啊!

NodeJS - request对象

NodeJS - request对象

Symfony4等效于显示当前路径