11 Replies Latest reply on May 22, 2007 7:17 AM by ilya_shaikovsky

    ajax4jsf javascript is not being included! Maybe configurati

    dandiodati

      HI Im trying to get ajax4jsf working, I followed the instructions and
      things seemed to be setup correctly, but the ajax4jsf javascript is not being included on the page. (javascript error indicating A4J object not found)

      I added the two included jars in my war, and added web.xml entries.
      I'm current using myfaces,seam, and facelets.

      I even set a break point on the ajax4jsf filter and it does seem to execute.
      What would cause this?


      Here is the web.xml:

      <filter>
       <filter-name>Seam Redirect Filter</filter-name>
       <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
       </filter>
      
       <filter>
       <filter-name>ajax4jsf</filter-name>
       <filter-class>org.ajax4jsf.Filter</filter-class>
       </filter>
      
       <filter>
       <filter-name>Seam Exception Filter</filter-name>
       <filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
       </filter>
      
       <filter-mapping>
       <filter-name>Seam Redirect Filter</filter-name>
       <servlet-name>faces-servlet</servlet-name>
       </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>
      
       <filter-mapping>
       <filter-name>Seam Exception Filter</filter-name>
       <servlet-name>faces-servlet</servlet-name>
       </filter-mapping>
      
       <!-- Faces Servlet -->
       <servlet>
       <servlet-name>faces-servlet</servlet-name>
       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
       <load-on-startup> 3 </load-on-startup>
       </servlet>
      
       <servlet-mapping>
       <servlet-name>faces-servlet</servlet-name>
       <url-pattern>/faces/*</url-pattern>
       </servlet-mapping>


        • 1. Re: ajax4jsf javascript is not being included! Maybe configu

          move Ajax4jsf filter on the top

          • 2. Re: ajax4jsf javascript is not being included! Maybe configu
            dandiodati

            The documentation indicates the configuration I have, but I tried moving
            it up like you said but it is still not working. No ajax4jsf javasript is included.
            Any other ideas?

            The web.xml now looks like:

            <filter>
             <filter-name>ajax4jsf</filter-name>
             <filter-class>org.ajax4jsf.Filter</filter-class>
             </filter>
            
            <filter>
             <filter-name>Seam Redirect Filter</filter-name>
             <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
             </filter>
            
            
             <filter>
             <filter-name>Seam Exception Filter</filter-name>
             <filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
             </filter>
            
            <filter-mapping>
             <filter-name>ajax4jsf</filter-name>
             <servlet-name>faces-servlet</servlet-name>
             <dispatcher>REQUEST</dispatcher>
             <dispatcher>FORWARD</dispatcher>
             <dispatcher>INCLUDE</dispatcher>
             </filter-mapping>
            
             <filter-mapping>
             <filter-name>Seam Redirect Filter</filter-name>
             <servlet-name>faces-servlet</servlet-name>
             </filter-mapping>
            
            
             <filter-mapping>
             <filter-name>Seam Exception Filter</filter-name>
             <servlet-name>faces-servlet</servlet-name>
             </filter-mapping>
            
             <!-- Faces Servlet -->
             <servlet>
             <servlet-name>faces-servlet</servlet-name>
             <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
             <load-on-startup> 3 </load-on-startup>
             </servlet>
            
             <servlet-mapping>
             <servlet-name>faces-servlet</servlet-name>
             <url-pattern>/faces/*</url-pattern>
             </servlet-mapping>


            • 3. Re: ajax4jsf javascript is not being included! Maybe configu

               

              <load-on-startup> 3 </load-on-startup>


              It looks like you have something else except Seam and Ajax4jsf. Do you use Shale or something like that?

              • 4. Re: ajax4jsf javascript is not being included! Maybe configu
                dandiodati

                I also have dwr servlet(mapped to /dwr and does not specify a load-on-startup number) that I was going to try out later. And there is a custom authentication filter which is put after the ajax4jsf filter for now.

                Not using shale or seam remoting.

                • 5. Re: ajax4jsf javascript is not being included! Maybe configu
                  dandiodati

                  I tried stripping it down to only whats needed and it still does not work.
                  I'm using jboss-ajax4jsf 1.1.0.

                  Is there some problem with the latest version, or is the documentation
                  not in sync?

                  Here is my latest web.xml(complete as is):

                  <?xml version="1.0" encoding="UTF-8"?>
                  <web-app>
                   <distributable/>
                  
                   <context-param>
                   <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                   <param-value>server</param-value>
                   </context-param>
                   <!-- Use Documents Saved as *.jsp -->
                   <context-param>
                   <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                   <param-value>.xhtml</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.ajax4jsf.SKIN</param-name>
                   <param-value>DEFAULT</param-value>
                   </context-param>
                  
                   <filter>
                   <filter-name>ajax4jsf</filter-name>
                   <filter-class>org.ajax4jsf.Filter</filter-class>
                   </filter>
                  
                   <filter-mapping>
                   <filter-name>ajax4jsf</filter-name>
                   <url-pattern>*.seam</url-pattern>
                   <dispatcher>REQUEST</dispatcher>
                   <dispatcher>FORWARD</dispatcher>
                   <dispatcher>INCLUDE</dispatcher>
                   </filter-mapping>
                  
                  
                   <listener>
                  <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
                  </listener>
                  
                   <listener>
                  <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
                  </listener>
                  
                  <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>*.seam</url-pattern>
                   </servlet-mapping>
                  
                  </web-app>



                  • 6. Re: ajax4jsf javascript is not being included! Maybe configu

                    I far as other people are able to run with 1.1.0, I vote for "the documentation
                    not in sync". I hope, you has no FaceletViewHandler registered in the faces-config.xml

                    • 7. Re: ajax4jsf javascript is not being included! Maybe configu
                      dandiodati

                      I have no FaceletViewHandler registered in my faces-config.xml.

                      Dan

                      • 8. Re: ajax4jsf javascript is not being included! Maybe configu
                        mousstik

                        hello,

                        dandiodati, did you resolve your problem ?
                        I have the same.
                        my tag <a4j:support> doesn't work in my seam application whereas it works in a simple JSF page.

                        The solution interests me :-)

                        • 9. Re: ajax4jsf javascript is not being included! Maybe configu
                          ilya_shaikovsky

                          attach please additional info about your settings and env.

                          • 10. Re: ajax4jsf javascript is not being included! Maybe configu
                            superfis

                            Hi there,

                            I have got the same problem and I have no solution yet.
                            Did you solve the problem? If yes, share you knowledge with me, please :)

                            Slawek

                            • 11. Re: ajax4jsf javascript is not being included! Maybe configu
                              ilya_shaikovsky

                              It would be better post individual environment description for every case. I do not shure that your problem is fully "the same"