ajax4jsf
  1. ajax4jsf
  2. AJAX4JSF-25

ajax4jsf 1.0.3 generates javascript error on WAS 6.0.2.5

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: Windows XP
      Platform: PC

    • Issuezilla Id:
      25

      Description

      Hi,

      i've been trying to get ajax4jsf 1.0.3 running on WAS 6.0.2.5.

      When I run the sample application (simple-repeater) I've get a javascript error
      "A4J is not defined". If you look at the generated HTML-code, you'll see that
      the DOCTYPE and the script tags are missing. The strange thing is, that if I
      take an older ajax4jsf.jar (like 1.0rc2) it works!!!

      Have you got any ideas?

      Regards, Oliver.

      PS: Enclosed are several config-files. I'm using Sun's JSF RI 1.1 and also tried
      IBM's JSF RI 1.1. Both give me the same error message.

      WAS-Information:
      WebSphere Platform 6.0 [BASE 6.0.2.5 cf50549.21] running with process name
      ws013013Node01Cell\ws013013Node01\server1 and process id 2096
      Host Operating System is Windows XP, version 5.1
      Java version = J2RE 1.4.2 IBM Windows 32 build cn142ifx-20060307 (142SR4-1 +
      98226) (JIT enabled: jitc), Java Compiler = jitc, Java VM name = Classic VM

      generated HTML-code:
      <html><head><title>ajax4jsf. Simple Repeator Demo</title></head><body><form
      id="_id0" method="post" action="/a4j_103_sun_ri/pages/demo.jsf"
      enctype="application/x-www-form-urlencoded"><table><tbody><tr><td>Type the
      Text:</td><td><input type="text" name="_id0:_id3" value=""
      onkeyup="A4J.AJAX.Submit('_viewRoot','_id0',event,{'parameters':{'_id0:_id4':'_id0:_id4'}})"
      size="50"></td></tr><tr><td>Text in the AJAX Response:</td><td><span
      id="_id0:repeater"></span></td></tr></tbody></table><input type="hidden"
      name="_id0" value="_id0"></form><hr>Source Code of This Page: <pre><%@ taglib
      uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <html>
      <head>
      <title>a4j Simple Repeator Demo</title>
      </head>
      <body>
      <f:view>
      <h:form>
      <h:panelGrid columns="2">

      <h:outputText value="Type the Text:" />
      <h:inputText value="#

      {bean.text}">
      <a4j:support event="onkeyup"
      reRender="repeater" />
      </h:inputText>

      <h:outputText value="Text in the AJAX Response:" />
      <h:outputText id="repeater" value="#{bean.text}

      " />

      </h:panelGrid>
      </h:form>
      <hr />
      <h:outputText value="Source Code of This Page:" />
      <f:verbatim>
      ....
      </f:verbatim>

      </f:view>
      </body>
      </html>
      </pre></body></html>

      faces-config.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE faces-config SYSTEM "./web-facesconfig_1_1.dtd">
      <faces-config>
      <managed-bean>
      <managed-bean-name>bean</managed-bean-name>
      <managed-bean-class>demo.Bean</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
      <managed-property>
      <property-name>text</property-name>
      <value />
      </managed-property>
      </managed-bean>

      <managed-bean>
      <description>Input Value Holder</description>
      <managed-bean-name>nameBean</managed-bean-name>
      <managed-bean-class>demo.NameBean</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
      <managed-property>
      <property-name>userName</property-name>
      <property-class>java.lang.String</property-class>
      <value />
      </managed-property>
      </managed-bean>

      <navigation-rule>
      <from-view-id>/pages/a4jStatus.jsp</from-view-id>
      </navigation-rule>
      </faces-config>

      web.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app id="WebApp_ID" 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">
      <display-name>a4j_103_sun_ri</display-name>

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

      <!-- Ajax4JSF Initial parameters -->
      <filter>
      <display-name>Ajax4jsf Filter</display-name>
      <filter-name>ajax4jsf</filter-name>
      <filter-class>org.ajax4jsf.Filter</filter-class>
      </filter>
      <filter-mapping>
      <filter-name>ajax4jsf</filter-name>
      <url-pattern>/*</url-pattern>
      </filter-mapping>
      <filter-mapping>
      <filter-name>ajax4jsf</filter-name>
      <servlet-name>Faces Servlet</servlet-name>
      <dispatcher>REQUEST</dispatcher>
      <dispatcher>FORWARD</dispatcher>
      <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>
      <!-- Ajax4JSF Initial parameters -->

      <listener>
      <listener-class>
      com.sun.faces.config.ConfigureListener
      </listener-class>
      </listener>

      <!-- 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>

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

      <welcome-file-list>
      <welcome-file>./index.jsp</welcome-file>
      </welcome-file-list>
      </web-app>

        Activity

        Hide
        Oliver Thomsen added a comment -

        Hi,

        I did some research: ajax4jsf.jar 1.0 and 1.0.1 are working, so the the problem
        occurs in versions 1.0.2 and greater!

        Regards, Oliver.

        Show
        Oliver Thomsen added a comment - Hi, I did some research: ajax4jsf.jar 1.0 and 1.0.1 are working, so the the problem occurs in versions 1.0.2 and greater! Regards, Oliver.
        Hide
        Oliver Thomsen added a comment -

        Hi,
        just solved the problem! Added

        <init-param>
        <param-name>forceparser</param-name>
        <param-value>false</param-value>
        </init-param>

        to the Ajax4JSF Filter in the web.xml and now it works!

        Regards, Oliver.

        PS Issue can be closed!

        Show
        Oliver Thomsen added a comment - Hi, just solved the problem! Added <init-param> <param-name>forceparser</param-name> <param-value>false</param-value> </init-param> to the Ajax4JSF Filter in the web.xml and now it works! Regards, Oliver. PS Issue can be closed!

          People

          • Assignee:
            ajax4jsf-issues
            Reporter:
            Oliver Thomsen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: