javax.servlet.ServletException: Función "rich:component" not found
lordblackred May 6, 2012 9:23 AMHello boys!
First I want to say it is a pleasure to start a part of this community and I hope graduallyto bring more of what I bring to my and, very important, sorry for my english xD
Well, my error it's obvious, I can't do anything with richfaces. I put one example of richfaces live demo but nothing, I want put a rich:popupPanel but only see plane text where must see the panel with the text of course.
I use richfaces richfaces 4.2.1 (the four librarys), Javax.faces 2.1.7, maven how archetype project (although my librarys richfaces and jsf I put it in build path manually) and hibernate for mapping DataBase. All it's ok less richfaces.
I read in the net many things about it, but nothing "clear", the jars I can't put in the web-if/lib because else tomcat not work, and I read too the make a managed bean that replace the class "rich:component" but i don't know good...
In my web.xml:
<?xml version="1.0"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" 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-app_2_5.xsd"> <display-name>Archetype Created Web Application</display-name> <!-- JSF --> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.jsf</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.xhtml</url-pattern> </servlet-mapping> </web-app>
In faces-config.xml I have put something? only I read
<?xml version="1.0" encoding="UTF-8"?> <faces-config xmlns="http://java.sun.com/xml/ns/javaee" 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_1.xsd" version="2.1"> .... managed bean and navegation-rules </faces-config>
My xhtml it's simple of richfaces live demo
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <h:commandButton value="Call the popup"> <rich:componentControl target="popup" operation="show" /> </h:commandButton> <rich:popupPanel id="popup" modal="true" resizeable="true" onmaskclick="#{rich:component('popup')}.hide()"> <f:facet name="header"> <h:outputText value="Simple popup panel" /> </f:facet> <f:facet name="controls"> <h:outputLink value="#" onclick="#{rich:component('popup')}.hide(); return false;"> X </h:outputLink> </f:facet> <p>You can also check and trigger events if the use clicks outside of the panel.</p> <p>In this example clicking outside closes the panel.</p> </rich:popupPanel> </ui:composition>
Very very thanks in advance. I hope you can help me.
Regards