JSF2.0 tags not found
Recently I've been playing around with JSF2.0+Richface 3.3.3, I'm using STS as my IDE and Maven to build my project, but somehow I can't get the following JSF2.0 tags to work:
- h:button
- h:link
- f:metadata
- f:viewParam (this is the only one my STS autocomplete recognizes)
It just fails during runtime saying it can't find X component.
I do have jsf-api-2.0.2, jsf-impl-2.0.2, richfaces-api-3.3.3.final, richfaces-impl-jsf2-3.3.3.final, richfaces-ui-3.3.3.final, jsf-facelets-1.1.15, jstl-1.0 and obvious开发者_如何学Pythonly "xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" in every .xhtml file, am I missing something?
This is the exact error I'm getting:
<h:button> Tag Library supports namespace: http://java.sun.com/jsf/html, but no tag was defined for name: button
@EDIT: ok nevermind, my teammate found out that its because we're using some external facelets and that we have to wait for RichFaces4.0...
have you removed the old jsf 1.2 libraries?
Check your WEB-INF/lib
to see that there is no trace of JSF 1.2 libs.
Also remember that you should update your faces-config
file to 2.0
<faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
Does it say something when starting the servlet: INFO: Initializing Mojarra 2.0.2 (FCS b10) for context '/nameofyourapplication'
(in case you are using Sun implementation of JSF)
Would you confirm that your maven pom.xml file has the following dependency:
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.0.2</version>
</dependency>
After completing a mvn clean install
on your project directory, search for the jsf jar files in the target
directory and ensure that 2.0 jars are found there.
If the issue is still not resolved, then indicate the web container that you are using and how your war is deployed into the server.
精彩评论