File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes J4J Tag Library rendering problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "J4J Tag Library rendering problems" Watch "J4J Tag Library rendering problems" New topic

J4J Tag Library rendering problems

Klaus Schuster
Ranch Hand

Joined: Feb 10, 2009
Posts: 30

I am using MyFaces 1.2.5 with Facelets and some Tomahawk libraries.
I am trying to use default actions with the J4J Tag library:
Default Action for a JSF Form

As a reason of using Facelets my xhtml File looks like as follows (only Code snippet):

I copied the j4j.jar File into the WEB-INF\lib folder.
In my web.xml I defined the following:

When I load the page, and I view my source code, I can see the tag <j4j:defaultAction></j4j:defaultAction> in Plain text. there is no rendering to java Script code.
Is there something else to do ?
Thanks in advance.

Klaus Schuster
Ranch Hand

Joined: Feb 10, 2009
Posts: 30
I found the solution!
The problem is, that I am using facelets together with the J4J library.
For that kind of implementation, you need to do the following steps for getting the default Action attribute:

- copy j4j.jar into WEBINF\lib
- Define a File named: "j4j.taglib.xml" in your META-INF folder with the following input:

In your xhtml Facelets File set the header:

and put the j4j Attribute with an ID in your form details to your commandButton tag:

thats all to use the default Action in JSF using Facelets.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16750

Yup. Facelets "adopts" custom tag libraries, but you have to tell it about the tags.

One of the downsides, however, is that straight JSP/JSF will detect invalid tag attributes. Facelets will ignore them.

Customer surveys are for companies who didn't pay proper attention to begin with.
harinder singh

Joined: Jan 14, 2010
Posts: 10
What version of Jboss you using ? it does not work for me when I upgraded the jboss to Jboss 5.0.1.
(It works for Jboss 4.2.3)
It is sorta covered in the JavaRanch Style Guide.
subject: J4J Tag Library rendering problems