JSP : request.getContextPath()

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>