Skip to main content

Command Palette

Search for a command to run...

JSP : request.getContextPath()

Published
1 min read
S

I love learning about technology and sharing that with others

This function request.getContextPath will be used to find the context path of the current application

contextPath is the name of the webapplication just after the port number, since a single application server can host multiple application that's why sometimes we need to find the context path.

In JSP file :

request.getContextPath()

<body>
Context Path Using implicit request object = "<%=request.getContextPath() %>"
<br>
Context Path Using JSP EL = "${pageContext.request.contextPath}"
</body>
106 views

More from this blog

H

hashcodehub

271 posts

Consistent, Passionate and Organized :)