3 Replies Latest reply on Mar 16, 2009 10:11 PM by Steffen Persch

    How to disable A4J

    Steffen Persch Newbie

      Hi together,


      everytime i add a header tag there appears in it the javascript files


      As soon as i add a header tag, it automatically loads those javascript files ( <script type='text/javascript' src='/..../a4j/g/3_2_2.GA/org/ajax4jsf/framework.pack.js'></script><script type='text/javascript' src='/..../a4j/g/3_2_2.GA/org/richfaces/ui.pack.js'></script> ).How can I prohibit this? I don't need anything of this and want to use other Java script libraries but which are not compatible with those.

        • 1. Re: How to disable A4J
          John Ament Master

          the richfaces libraries are added to all pages that use the A4J filter.  check your web.xml for this filter.  note that disabling it means that you can't use the a4j jsf implementation.  there are work arounds for using other libraries, such as caling jquery() instead of $()

          • 2. Re: How to disable A4J
            Steffen Persch Newbie

            Thank you for the quick answer. So i don't need any a4j functions and so it should be not a problem for me. but i cant find the a4j filter, could you please check my web.xml:


            <?xml version="1.0" ?>
            <web-app 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"
               version="2.5">

               <display-name>rollertreffen.com</display-name>


               <!-- RichFaces -->
              
               <context-param>
                  <param-name>org.richfaces.SKIN</param-name>
                  <param-value>classic</param-value>
               </context-param>

               <!-- Suppress spurious stylesheets -->

               <context-param>
                  <param-name>org.richfaces.CONTROL_SKINNING</param-name>
                  <param-value>disable</param-value>
               </context-param>

               <context-param>
                  <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
                  <param-value>disable</param-value>
               </context-param>

               <!-- Change load strategy to DEFAULT to disable sending scripts/styles as packs -->

               <context-param>
                  <param-name>org.richfaces.LoadStyleStrategy</param-name>
                  <param-value>ALL</param-value>
               </context-param>

               <context-param>
                  <param-name>org.richfaces.LoadScriptStrategy</param-name>
                  <param-value>ALL</param-value>
               </context-param>

               <!-- Seam -->
              
               <listener>
                  <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
               </listener>

               <filter>
                  <filter-name>Seam Filter</filter-name>
                  <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
               </filter>

               <filter-mapping>
                  <filter-name>Seam Filter</filter-name>
                  <url-pattern>/*</url-pattern>
               </filter-mapping>

                <servlet>
                    <servlet-name>MT Upload Servlet</servlet-name>
                    <servlet-class>com.rollertreffen.service.UploadServlet</servlet-class>
                </servlet>
               
                <servlet-mapping>
                    <servlet-name>MT Upload Servlet</servlet-name>
                    <url-pattern>/upload/servlet</url-pattern>
                </servlet-mapping>

               <servlet>
                  <servlet-name>Seam Resource Servlet</servlet-name>
                  <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
               </servlet>
              
               <servlet-mapping>
                  <servlet-name>Seam Resource Servlet</servlet-name>
                  <url-pattern>/seam/resource/*</url-pattern>
               </servlet-mapping>
              
               <context-param>
                <param-name>org.jboss.seam.core.init.debug</param-name>
                <param-value>false</param-value>
               </context-param>
             
               <!-- Facelets development mode (disable in production) -->
             
               <context-param>
                  <param-name>facelets.DEVELOPMENT</param-name>
                  <param-value>false</param-value>
               </context-param>
             
               <!-- JSF -->
             
               <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>-1</param-value>
               </context-param>

               <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>*.seam</url-pattern>
               </servlet-mapping>
                         
               <security-constraint>
                  <display-name>Restrict raw XHTML Documents</display-name>
                  <web-resource-collection>
                     <web-resource-name>XHTML</web-resource-name>
                     <url-pattern>*.xhtml</url-pattern>
                  </web-resource-collection>
                  <auth-constraint/>
               </security-constraint>


            </web-app>

            • 3. Re: How to disable A4J
              Steffen Persch Newbie

              i choosed the wrong formatting, here my web.xml again:



              <?xml version="1.0" ?>
              <web-app 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" 
                 version="2.5">
              
                 <display-name>rollertreffen.com</display-name>
              
              
                 <!-- RichFaces -->
                 
                 <context-param>
                    <param-name>org.richfaces.SKIN</param-name>
                    <param-value>classic</param-value>
                 </context-param>
              
                 <!-- Suppress spurious stylesheets -->
              
                 <context-param>
                    <param-name>org.richfaces.CONTROL_SKINNING</param-name>
                    <param-value>disable</param-value>
                 </context-param>
              
                 <context-param>
                    <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
                    <param-value>disable</param-value>
                 </context-param>
              
                 <!-- Change load strategy to DEFAULT to disable sending scripts/styles as packs -->
              
                 <context-param>
                    <param-name>org.richfaces.LoadStyleStrategy</param-name>
                    <param-value>ALL</param-value>
                 </context-param>
              
                 <context-param>
                    <param-name>org.richfaces.LoadScriptStrategy</param-name>
                    <param-value>ALL</param-value>
                 </context-param>
               
                 <!-- Seam -->
                 
                 <listener>
                    <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
                 </listener>
              
                 <filter>
                    <filter-name>Seam Filter</filter-name>
                    <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
                 </filter>
              
                 <filter-mapping>
                    <filter-name>Seam Filter</filter-name>
                    <url-pattern>/*</url-pattern>
                 </filter-mapping>
              
                  <servlet>
                      <servlet-name>MT Upload Servlet</servlet-name>
                      <servlet-class>com.rollertreffen.service.UploadServlet</servlet-class>
                  </servlet>
                  
                  <servlet-mapping>
                      <servlet-name>MT Upload Servlet</servlet-name>
                      <url-pattern>/upload/servlet</url-pattern>
                  </servlet-mapping>
              
                 <servlet>
                    <servlet-name>Seam Resource Servlet</servlet-name>
                    <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
                 </servlet>
                 
                 <servlet-mapping>
                    <servlet-name>Seam Resource Servlet</servlet-name>
                    <url-pattern>/seam/resource/*</url-pattern>
                 </servlet-mapping>
                 
                 <context-param>
                  <param-name>org.jboss.seam.core.init.debug</param-name>
                  <param-value>false</param-value>
                 </context-param>
                
                 <!-- Facelets development mode (disable in production) -->
                
                 <context-param>
                    <param-name>facelets.DEVELOPMENT</param-name>
                    <param-value>false</param-value>
                 </context-param>
                
                 <!-- JSF -->
                
                 <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>-1</param-value>
                 </context-param>
              
                 <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>*.seam</url-pattern>
                 </servlet-mapping>
                            
                 <security-constraint> 
                    <display-name>Restrict raw XHTML Documents</display-name>
                    <web-resource-collection>
                       <web-resource-name>XHTML</web-resource-name>
                       <url-pattern>*.xhtml</url-pattern>
                    </web-resource-collection>
                    <auth-constraint/>
                 </security-constraint>
               
               
              </web-app>