can anyone explain what will this pageContext.request.contextPath does?it would be helpful if you give an example.Thanks in advance.
${pageContext.request.contextPath}
is an EL expression equivalent to the JSP expression <%= request.getContextPath() %>
.
It is recommended to use ${pageContext.request.contextPath}
instead of hard-coding your context path.
E.g. <a href="${pageContext.request.contextPath}/info/page.html">Link</a>
is better than <a href="http://abc.xyz.com/info/page.html">Link</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With