URI « Request « JSP-Servlet Q&A





1. How can you get the original REQUEST_URI from within a Struts 2 Action reached via an apache ErrorDocument redirection?    stackoverflow.com

How can you access the REQUEST_URI from within a Struts 2 Action? In perl/php/ruby it is readily available via ENV["REQUEST_URI"] and the like. In java it seems that the PageContext.getErrorData().getRequestURI() is ...

2. How to get the request url from HttpServletRequest    stackoverflow.com

Say i make a get request like this:

GET http://cotnet.diggstatic.com:6000/js/loader/443/JS_Libraries,jquery|Class|analytics|lightbox|label|jquery-dom|jquery-cookie?q=hello#frag HTTP/1.0
Host: cotnet.diggstatic.com:6000
My servlet takes request like this: HttpServletRequest req; When i debug my server and execute, i get the following:
req.getRequestURL().toString() = "http://cotnet.diggstatic.com:6000/js/loader/443/JS_Libraries,jquery%7cClass%7canalytics%7clightbox%7clabel%7cjquery-dom%7cjquery-cookie"
req.getRequestURI() = "/js/loader/443/JS_Libraries,jquery%7cClass%7canalytics%7clightbox%7clabel%7cjquery-dom%7cjquery-cookie"
req.getQueryString() ...

3. How to get request URI without context path?    stackoverflow.com

request.getRequestURI() returns URI with context path. For example, if the base URL of an application is http://localhost:8080/myapp/, and we run request.getRequestURI() for http://localhost:8080/myapp/secure/users, it will return /myapp/secure/users. Is there any way ...

4. RequestDispatcher class of the servlet package does not have FORWARD_REQUEST_URI field    stackoverflow.com

I am trying to build a Java EE application using Maven. I have the following in my pom.xml:

    <dependency>
        <groupId>javax.servlet</groupId>
  ...

5. include.request_uri attribute    coderanch.com

6. Servlet Filters + Request URI    coderanch.com