1 Reply Latest reply on Aug 15, 2008 4:13 PM by aparna mudumbi

    a4jEchoText not working

    aparna mudumbi Newbie

      Hi,

      I am a newbie with JSF and RichFaces. I am trying to run a4jEchoText from the developer guide. But it doesn't seem to work. I can see the page but when I type, I see a "Error on Page" displayed in the browser and there is no echo.

      I am running the application on tomcat 5.5 with JSP 1.2

      jars in my web-inf/lib
      -------------------------
      common-annotations.jar
      commons-beanutils.jar
      commons-collections.jar
      commons-digester.jar
      commons-logging.jar
      el-api.jar
      el-ri.jar
      jsf-api.jar
      jsf-facelets.jar
      jsf-impl.jar
      jstl.jar
      richfaces-api-3.2.0.GA.jar
      richfaces-impl-3.2.0.GA.jar
      richfaces-ui-3.2.0.GA.jar
      standard.jar

      HTML
      --------
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j">


      RichFaces



      <rich:panel header="Simple Echo">
      <h:inputText size="50" value="#{bean.text}" >
      <a4j:support event="onkeyup" reRender="rep"/>
      </h:inputText>
      <h:outputText id="rep" value="#{bean.text}" />
      </rich:panel>




      GENERATED SOURCE
      -------------------------
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >



      RichFaces


      Simple Echo<input type="text" name="j_id3" value="null" onkeyup="A4J.AJAX.Submit('_viewRoot',null,event,{'parameters':{'j_id4':'j_id4'} ,'actionUrl':'/RichFaces/start.jsf'} )" size="50" />null



      Script Error
      ---------------
      Error: Object Required

      web.xml
      ----------
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

      Sample application

      <display-name>login</display-name>

      <context-param>
      <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
      <param-value>.xhtml</param-value>
      </context-param>

      <context-param>
      <param-name>facelets.REFRESH_PERIOD</param-name>
      <param-value>2</param-value>
      </context-param>

      <context-param>
      <param-name>facelets.DEVELOPMENT</param-name>
      <param-value>true</param-value>
      </context-param>

      <context-param>
      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
      <param-value>server</param-value>
      </context-param>

      <context-param>
      <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
      <param-value>com.sun.facelets.FaceletViewHandler</param-value>
      </context-param>

      <context-param>
      <param-name>org.richfaces.SKIN</param-name>
      <param-value>blueSky</param-value>
      </context-param>


      <display-name>Ajax4jsf Filter</display-name>
      <filter-name>ajax4jsf</filter-name>
      <filter-class>org.ajax4jsf.Filter</filter-class>


      <filter-mapping>
      <filter-name>ajax4jsf</filter-name>
      <servlet-name>Faces Servlet</servlet-name>
      REQUEST
      FORWARD
      INCLUDE
      </filter-mapping>


      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>


      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.jsf</url-pattern>
      </servlet-mapping>

      <login-config>
      <auth-method>BASIC</auth-method>
      </login-config>
      </web-app>

      Thanks in advance
      -Aparna