Theobject breaks down the request URL into components. Servlets and JSP pages can use those components to vary the response while using the same servlet or JSP page.
Some reasons you may need to look at the URL information:
returns the full path, excluding any query string.
returns the URI prefix that matches the servlet. In the case of a JSP, it will return everything up to the *.jsp.
The servlet path is useful for servlets like JSP, XTP, or SSI that read and transform files.
returns everything after the ServletPath.
A discussion board servlet could use PathInfo to select stories and comments.
returns the query string, everything after the '?'
Often, query strings are the result of form submissions but it's also useful for database-driven sites. For example, you might encode "story 15, comment 7" of a discussion as.