विधि request.getRequestURI() संदर्भ पथ के साथ यूआरआई लौटाता है।संदर्भ पथ के बिना अनुरोध यूआरआई कैसे प्राप्त करें?
उदाहरण के लिए, यदि कोई अनुप्रयोग के लिए आधार URL http://localhost:8080/myapp/
है (अर्थात संदर्भ पथ MyApp है), और मैं फोन request.getRequestURI()
http://localhost:8080/myapp/secure/users
के लिए, यह /myapp/secure/users
वापस आ जाएगी।
क्या कोई तरीका है कि हम केवल इस भाग को /secure/users
प्राप्त कर सकते हैं, यानी संदर्भ पथ के बिना यूआरआई?
के संभावित डुप्लिकेट [क्या HttpServletRequest में getRequestURI और getPathInfo विधियों के बीच अंतर है?] (http://stackoverflow.com/questions/4931323/whats-the-difference-between-getrequesturi-and-getpathinfo-methods-in-httpservl) – Leonel