The javax.servlet.http.HttpServletRequest.getPathInfo method returns the extra path information contained in the request URL after the servlet path and before the query string. If there is no extra path information, this method returns null.
Example 1: Suppose the request URL is http://example.com/appcontext/servlet/path/info. The servlet path is "/servlet" and the extra path information is "/path/info". The code snippet to retrieve the extra path information is as follows:
Example 2: Suppose the request URL is http://example.com/appcontext/servlet. In this case, there is no extra path information, so the method returns null:
This method belongs to the javax.servlet.http package library, which is part of the Java Servlet API.
Java HttpServletRequest.getPathInfo - 30 examples found. These are the top rated real world Java examples of javax.servlet.http.HttpServletRequest.getPathInfo extracted from open source projects. You can rate examples to help us improve the quality of examples.