Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Run-Time expression evaluation does not work with custom TagLib

0 views
Skip to first unread message

Haithem Hmida

unread,
Apr 15, 2002, 3:32:41 PM4/15/02
to

Using WebLogic EJB to JSP Integration Tool, I have created a custom TagLib.
I can properly deploy/start my Web application (a WAR file), but whenever I go
to the JSP page that is using the custom Tag, I get the following exception:

java.lang.ClassCastException: java.lang.Object
at javax.servlet.jsp.tagext.TagData.getAttributeString(TagData.java:165)

Here is what I have in my JSP page:

<%@ taglib uri="Students-tags" prefix="students" %>
<%
String studentID = (String)session.getAttribute("studentID");
%>
<students:Register studentID="<%=studentID%>" />
<%

My TLD file looks like this:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
<taglib>
<tlibversion>1.0</tlibversion>
<shortname>ejb2jsp generated tag library</shortname>
<tag>
<name>Register</name>
<tagclass>EJBs.Students.jsp_tags._Students_RegisterTag</tagclass>
<teiclass>EJBs.Students.jsp_tags._Students_RegisterTagTEI</teiclass>
<info>
attribute 'studentID' expects java type 'java.lang.String'
</info>
<attribute>
<name>studentID</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
</taglib>

And my Web.xml file does have the following entry:

<taglib>
<taglib-uri>
Students-tags
</taglib-uri>
<taglib-location>
/WEB-INF/Students-tags.tld
</taglib-location>
</taglib>


Does anybody know what is the cause of this exception ?

0 new messages