Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

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

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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 ]
 
Sheriff
Posts: 67537
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

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).
 
Sean Stephens
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Noted.

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

https://coderanch.com/t/285916/JSP/java/Getting-error-accessing-attributes-custom
 
    Bookmark Topic Watch Topic
  • New Topic