Hello everybody,
I have a JSP tag file, which sets an attribute to the PageContext. I
expect this attribute to be present in child tags.
Here is the outer tag (in a file "outer.tag"):
<%@ tag language="java" pageEncoding="ISO-8859-1"%>
<%@ variable name-given="test" scope="NESTED" %>
<%
jspContext.setAttribute ("test", "This is a test !",
PageContext.PAGE_SCOPE);
%>
Value before doBody: ${test} <br>
<jsp:doBody/>
Value after doBody: ${test} <br>
The tag just sets a string "This is a test !" to a page scope attribute
"test" and calls the tag body.
This is the inner tag (file "inner.tag"):
<%@ tag language="java" pageEncoding="ISO-8859-1"%>
Value in inner tag: ${test} <br/>
My JSP is this:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="tagfiles" tagdir="/WEB-INF/tags" %>
<html>
<head>
</head>
<body>
<tagfiles:outer>
Value in test.jsp: ${test} <br>
<tagfiles:inner/>
</tagfiles:outer>
<br/>
The browser shows this:
Value before doBody: This is a test !
Value in test.jsp: This is a test !
Value in inner tag:
Value after doBody: This is a test !
The problem is the empty output in the inner tag. I expect the third
line to be "Value in inner tag: This is a test !".
If I code this with tag classes, everything works fine: the attribute is
set through "this.pageContext.setAttribute("test", "This is a test !");"
and the inner tag finds the value with
"this.getJspContext().getAttribute("test", PageContext.PAGE_SCOPE);".
Can anybody help? Is such a thing possible with tag files? Or is this a bug?
I can provide a full WAR file if necessary.
Thanks
Wolfgang
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]