How do I get web application context path in JSP?

Category: jsp.snippets, viewed: 45K time(s).

This example show you how to obtain web application context path in JSP using Expression Language (EL) feature of JSP.

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
      <title>JSP - Context Path</title>
  </head>

  <body>
    Web Application Context Path = ${pageContext.request.contextPath}
  </body>
</html>
Powered by Disqus