我想request.getContextPath()在一个扩展了的JSP标记内调用SimpleTagSupport,有什么办法吗?
request.getContextPath()
SimpleTagSupport
首先获取PageContext被继承者SimpleTagSupport#getJspContext(),然后获取HttpServletRequestby PageContext#getRequest()。
PageContext
SimpleTagSupport#getJspContext()
HttpServletRequest
PageContext#getRequest()
PageContext pageContext = (PageContext) getJspContext(); HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();