3 Replies Latest reply on Mar 1, 2008 11:10 AM by Viggo Navarsete

    Problem running a sample SunJSF/RichFaces application

    Amol Desai Newbie

      Hi there,

      My sample SunJSF/RichFaces app is not working as desired. The JSP code is like below:

      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      
      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
      
      
      <!-- a -->
      <html>
      <head>
      <title>repeater </title>
      </head>
      <body>
      
      <f:view>
      
      
       <rich:panel>
      
       <a4j:outputPanel layout="block">
       <a4j:outputPanel ajaxRendered="true">
       <h:message for="text2" style="color:red" />
       </a4j:outputPanel>
      
       <h:form>
       <h:outputText value="Enter Text:"/>
       <h:inputText id="text2" label="text1" value="#{user.text2}">
       <f:validateLength maximum="10"/>
       <a4j:support event="onkeyup" reRender="out2" />
       </h:inputText>
       </h:form>
      
       <a4j:outputPanel layout="none">
       <h:outputText id="out2" rendered="#{not empty user.text2}" value="Approved Text: #{user.text2}" />
       </a4j:outputPanel>
       </a4j:outputPanel>
       </rich:panel>
      
      </f:view>
      </body>
      </html>
      
      
      
      If i type something in the input box, it is suppose to output as i go on typing... but its not happening. There is a JavaScript error. It says - A4J is undefined. Also, following declarations are showing red underlines i.e. unable to find tag libraries:
      
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      
      I did download "richfaces-ui-3.1.4.GA-bin.zip" and copied 3 jar files into the application's lib folder. I do not see any JSF core tag libraries in any othese jars.
      
      Appreciate your help.
      Regards,
      -amol
      


        • 1. Re: Problem running a sample SunJSF/RichFaces application
          Ilya Shaikovsky Master

          Are you have our filter defined in web.xml?

          • 2. Re: Problem running a sample SunJSF/RichFaces application
            Amol Desai Newbie

            Thanks for your reply.

            This is how my web.xml look. Can you please let me know whats wrong in it, if at all anything wrong?

            <?xml version="1.0"?>
            <!DOCTYPE web-app PUBLIC
             "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
             "http://java.sun.com/dtd/web-app_2_3.dtd">
            <web-app>
            
             <context-param>
             <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
             <param-value>client</param-value>
             </context-param>
            
             <context-param>
             <param-name>javax.faces.application.CONFIG_FILES</param-name>
             <param-value>/WEB-INF/faces-config.xml</param-value>
             </context-param>
            
             <context-param>
             <param-name>com.sun.faces.validateXml</param-name>
             <param-value>true</param-value>
             </context-param>
            
             <!-- Faces Servlet -->
             <servlet>
             <servlet-name>Faces Servlet</servlet-name>
             <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
             <load-on-startup>1</load-on-startup>
             </servlet>
            
            
            
             <!-- Added by AmolD - 27th Feb 08 Start -->
             <context-param>
             <param-name>org.richfaces.SKIN</param-name>
             <param-value>blueSky</param-value>
             </context-param>
            
            
            
             <filter>
             <display-name>RichFaces Filter</display-name>
             <filter-name>richfaces</filter-name>
             <filter-class>org.ajax4jsf.Filter</filter-class>
             </filter>
             <filter-mapping>
             <filter-name>richfaces</filter-name>
             <servlet-name>Faces Servlet</servlet-name>
             <dispatcher>REQUEST</dispatcher>
             <dispatcher>FORWARD</dispatcher>
             <dispatcher>INCLUDE</dispatcher>
             </filter-mapping>
             <!-- End -->
            
            
             <!-- Faces Servlet Mapping -->
             <servlet-mapping>
             <servlet-name>Faces Servlet</servlet-name>
             <url-pattern>*.jsf</url-pattern>
             </servlet-mapping>
            
            </web-app>
            


            • 3. Re: Problem running a sample SunJSF/RichFaces application
              Viggo Navarsete Expert

              If you look in the Developer Guide listed as a URL from the "Important links" post on the frontpage, you would be able to see how to configure your web.xml