You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2003/12/22 08:54:07 UTC

DO NOT REPLY [Bug 25689] New: - Request attributes are unavailable to jspf included by pageContext.include()

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25689>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25689

Request attributes are unavailable to jspf included by pageContext.include()

           Summary: Request attributes are unavailable to jspf included by
                    pageContext.include()
           Product: Tomcat 4
           Version: 4.1.19
          Platform: Other
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Jasper 2
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: willievu@yahoo.com


I've a custom tag.  In its doStartTag, a request attribute is set before a jspf
is included, as follows:

this.pageContext.getRequest().setAttribute("foo", value);		
this.pageContext.include("/WEB-INF/jspf/part/text.jspf");

In the text.jspf, the request attribute should be printed out by:

<c:out value="${requestScope['foo']}"/>

However, no value is displayed.  

The same <c:out> line can display the request attribute if it is in the original
jsp that contains the custom tag.

If the text.jspf is renamed to text.jsp, the request value is printed out. 
Another workaround is to add the following into tomcat's web.xml:

<servlet-mapping>
  <servlet-name>jsp</servlet-name>
  <url-pattern>*.jspf</url-pattern>
</servlet-mapping>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org