Thursday 31 July 2014

Request Path Elements

Request path leads to a servlet, that process the request.

RequestPath = ContextPath + ServletPath + PathInfo

Servlet Path
This path directly corresponds to the mapping which activated this request.

Context Path
The path prefix associated with the ServletContext that this servlet is a part of.

PathInfo
The part of the request path that is not part of the Context Path or the
Servlet Path. It is either null if there is no extra path, or is a string with a leading
'/'.

HttpServletRequest interface provides below methods, to get servlet path, context path and path information.
     getContextPath()
     getServletPath()
     getPathInfo()




Prevoius                                                 Next                                                 Home

No comments:

Post a Comment