hi all,
i have a problem with tag libraries tomcat 4.1.10. i'm trying to define a
scripting variable using TagExtraInfo, but jasper2 cannot compile my jsp and
gives this error:
---
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 4 in the jsp file: /webinfo.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\java\jakarta-tomcat-4.1.10-LE-jdk14\work\Standalone\localhost\xaura\webin
fo_jsp.java:71: cannot resolve symbol
symbol : variable ciao
location: class org.apache.jsp.webinfo_jsp
out.print( ciao );
^
1 error
---
here's the jsp:
---
<%@ taglib uri="http://www.tiscali.com/webinfo/taglib" prefix="webinfo" %>
<webinfo:string id="ciao" xpath="website/section[1]/@name"/>
<%= ciao %>
---
here's the tag definition in the TLD:
---
<tag>
<name>string</name>
<tagclass>com.tiscali.xaura.frontend.webinfo.taglib.StringTag</tagclass>
<teiclass>com.tiscali.xaura.frontend.webinfo.taglib.StringTei</teiclass>
<attribute>
<name>id</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<name>xpath</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
---
in the tag handler i set the pageContext attribute:
---
public int doStartTag() throws JspException {
[...]
pageContext.setAttribute(id, data);
[...]
}
---
in the TagExtraInfo class:
---
public VariableInfo[] getVariableInfo(TagData data) {
String id = data.getId();
if (id != null) {
logger.debug("id; " + id);
String classname = getClassName();
VariableInfo vi = new VariableInfo(id, classname, true,
VariableInfo.AT_END);
VariableInfo[] info = {vi};
return info;
} else {
logger.debug("id is null");
return null;
}
}
---
Am I missing something???
flavio tordini
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>