File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Can't Pass object to custom tag attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Can Watch "Can New topic
Author

Can't Pass object to custom tag attribute

Milo Timbol
Greenhorn

Joined: Oct 25, 2011
Posts: 1
Hi,

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.

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


Here's my Code
JSP




Hello.java


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

http://www.mail-archive.com/resin-interest@caucho.com/msg00283.html

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.

Milo
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60996
    
  65

Please be sure to ask JSF questions in the JSF forum. I have moved this post there for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16012
    
  19

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't Pass object to custom tag attribute