title: Java (JSP/Servlet): equivalent of getServletContext() from inside a .jsp
body: <p>How should I access the ServletContext from a .jsp? For example, how can I call the <em>getRealPath</em> method from inside a .jsp.</p>
  
  <p>Here's a Servlet, which works fine:</p>
  
  <pre><code>protected void doGet(
              HttpServletRequest req,
              HttpServletResponse resp
      ) throws ServletException, IOException {
          resp.setContentType( "text/html; charset=UTF-8" );
          final PrintWriter pw = resp.getWriter();
          pw.print( "&lt;html&gt;&lt;body&gt;" );
          pw.print( getServletContext().getRealPath( "text/en" ) );
          pw.print( "&lt;/body&gt;&lt;/html&gt;" );
          pw.flush();
          pw.close();
      }
  </code></pre>
  
  <p>Now I'm looking for the exact line I'm supposed to insert in the following <em>.jsp</em> to do exactly the same thing as the servlet above is doing.</p>
  
  <pre><code>&lt;%@ page contentType="text/html;charset=UTF-8" language="java" %&gt;
  &lt;html&gt;
    &lt;body&gt;
       ...  // What should I insert here   
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>