Java (JSP/Servlet): equivalent of getServletContext() from inside a .jsp
- by Webinator
How should I access the ServletContext from a .jsp? For example, how can I call the getRealPath method from inside a .jsp.
Here's a Servlet, which works fine:
protected void doGet(
HttpServletRequest req,
HttpServletResponse resp
) throws ServletException, IOException {
resp.setContentType( "text/html;…