I reviewed various questions about taglib and implicit objects here. Although many of the answers provide interesting ideas, I could not find one that directly answers this question.
So, to illustrate my dilemma, let's say I have a Java class that implements the javax.servlet.jsp.tagext.Tag interface ...
import javax.servlet.ServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.Tag;
class MyTag implements Tag {
private PageContext _pageContext;
public void setPageContext(PageContext pageContext) {
_pageContext = pageContext;
}
.
.
.
This gives me access to the PageContext object, which provides some useful information about the calling JSP. The problem is that PageContext does not seem to provide access to many real JSP implicit objects ...
.
.
.
public int doEndTag() throws JspException {
ServletRequest req = _pageContext.getRequest();
.
.
.
return EVAL_PAGE;
}
ServletRequest, , HttpServletRequest, "" JSP. , HttpServletRequest.getRequestURI(), .
, , , . JSP...
<mc:mytag request="<%=request%>"/>
... , , - , ...
<% session.setAttribute("request", request); %>
, , ... ? - , . JSP- , taglib. , , , - PageContext, , .
, - , , , . - ?