You can use ${pagecontext.request.contextpath} when you use it, and you can use <%=request.getcontextpath ()%> to achieve the same effect, and you can also ${ PageContext.request.contextPath}, put in a JSP file, will be placed in a variable with c:set, and then use the EL expression to take out.
Such as:
1 <c:set var= "CTX" value= "${pagecontext.request.contextpath}"/>
2 <c:set var= "Resources" value= "${pagecontext.request.contextpath}/resources"/>
The EL expression takes a variable method:
Variable
The EL Access variable data method is simple, for example: ${username}. It means to take out a variable whose name is username in a range.
Because we do not specify a range of username, it will be searched sequentially from page, Request, Session, application range.
If the way to find username, direct callback, no longer continue to find, but if all the scope is not found, the return null.
Reference: http://www.cnblogs.com/langtianya/archive/2013/03/04/2942515.html
http://blog.csdn.net/qwerasdf123/article/details/4189889
${pagecontext.request.contextpath} jsp gets absolute path