This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Tomcat and the fly likes JasperException when trying to pass non-String custom taglib attribute. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Tomcat
Reply locked New topic
Author

JasperException when trying to pass non-String custom taglib attribute.

Sean Stephens
Ranch Hand

Joined: Oct 25, 2004
Posts: 40
cross posting from jsp forum because its a Tomcat error.

I'm using a custom taglib with an attribute. When I try to refer to the attribute in the tag, then I get an error of type:

org.apache.jasper.JasperException: jsp.error.beans.property.conversion
org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManager(JspRuntimeLibrary.java:885)
org.apache.jsp.content.includes.treetest_jsp._jspx_meth_odin_showNavTree_0(treetest_jsp.java:148)
org.apache.jsp.content.includes.treetest_jsp._jspService(treetest_jsp.java:114)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)


Please help Below is some pertinent code info. Let me know if you need more.

Thanks,
Sean

--- from jsp ---
<jsp:useBean id="u" class="com.renewdata.odin.user.OdinUserBean" scope="request">
<jsp:setProperty name="u" property="email" value="tempemail" />
<jsp:setProperty name="u" property="name" value="tempname" />
</jsp:useBean>
<jsp:useBean id="bc" class="com.renewdata.odin.nav.Breadcrumb" scope="request" />

<tr><td height='100%' valign=top width=50% nowrap style='overflow:auto;'>
<odin:showNavTree user="u"/>
</td></tr>
--- end jsp ---

--- start tld ---
<tag>
<name>showNavTree</name>
<tagclass>com.company.odin.nav.ShowNavTreeTag</tagclass>
<bodycontent>empty</bodycontent>
<info>
Given the information included in the attributes, this tag builds
the navigation tree.
</info>

<attribute>
<name>breadcrumb</name>
<type>com.company.odin.nav.Breadcrumb</type>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

<attribute>
<name>user</name>
<type>com.company.odin.user.OdinUserBean</type>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

</tag>

--- end tld ---

--- excerpt from handler ---
public class ShowNavTreeTag extends TagSupport {
private Log avsLog;

private Breadcrumb breadcrumb;
private OdinUserBean user;


public Breadcrumb getBreadcrumb() {
return breadcrumb;
}
public void setBreadcrumb(Breadcrumb breadcrumb) {
this.breadcrumb = breadcrumb;
}
public OdinUserBean getUser() {
return user;
}
public void setUser(OdinUserBean user) {
this.user = user;
}
--- end handler ---
[ October 26, 2004: Message edited by: Sean Stephens ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61449
    
  67

cross posting from jsp forum because its a Tomcat error.


Sean, cross-posting is against Ranch policy. It wastes people's time when multiple redundant conversations take place. If I had felt that your question was Tomcat-specific, I would have moved it here accordingly.

Please continue any discussion in the JSP forum (where I have answered your question).


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sean Stephens
Ranch Hand

Joined: Oct 25, 2004
Posts: 40
Noted.

For anyone finding the message here for the first time, the solution is here:

http://www.coderanch.com/t/285916/JSP/java/Getting-error-accessing-attributes-custom
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JasperException when trying to pass non-String custom taglib attribute.