Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can't Pass object to custom tag attribute  RSS feed

Milo Timbol
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I get this error when i try to pass an object in the custom tags attribute.

[show] /signmodule/campaign/signsList.jsp:14: expected '<%= ... %>' at '#{signsBean.folderTreeDataModel}'
for tag attribute setter 'setDataModel(com.jscape.framework.galileo.components.treemodel.BaseTreeDataModel)'.
Tag attributes which can't be converted from strings must use a runtime
attribute expression.

13: <body style="margin-left:12px;">
14: <sample:hello dataModel="#{signsBean.folderTreeDataModel}" />
15: </body>
16: </html>

Here's my Code

TLD file

This is the old code that worked. It used a different tree component that we are trying to replace.

The closest related topic I found on the internet is this one

They were talking about resin settings (changes in web.xml) which I tried to but didnt work. Do you guys know how to solve this?

Im running resin 3.2.1.

Thanks in advance.

Bear Bibeault
Author and ninkuma
Posts: 66040
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to ask JSF questions in the JSF forum. I have moved this post there for you.
Tim Holloway
Saloon Keeper
Posts: 18635
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, Milo!

I suspect that your primary problem is that this view isn't being routed through the FacesServlet and the stock JSP processor didn't like your JSF-style EL.

A bigger issue, however, is that I seriously doubt that a standard JSP custom tag is going to work at all well on a JSF View definition. While JSF may have started out from a JSP perspective, it has diverged considerably since then. And done so in so messy a manner that I always caution people to try to avoid developing binary-level custom JSF tags and instead use Facelets xthml tag definitions or similar mechanisms wherever possible. Among other things, a proper JSF custom tag has to be set up to allow a plug-in rendering engine, and not the "brute force" simple scheme that ordinary JSPs do.

On the plus side, however, there are a number of JSF extension tagsets that come with their own tree controls already debugged and ready to use. Not to mention tons of other useful control types.
This will take every ounce of my mental strength! All for a tiny ad:
Thoughts on deprecation in Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!