2 Replies Latest reply on Oct 12, 2010 9:22 AM by Agustin Sivoplás Ferrari

    Optimizing JSF, Richfaces and Facelets

    Agustin Sivoplás Ferrari Expert

      I found in a web page how i can optimize my application, but i not really sure this is parameters are correct. Can tell me this is fine? Example the parameter org.ajax4jsf.COMPRESS_SCRIPT should be true or false?

       

      Copy my 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">
      
           <display-name>ITIL Gestion de Configuracion</display-name>
           <description>ITE-ITIL</description>
      
           <!-- Use Documents Saved as *.xhtml -->
      
           <context-param>
                <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                <param-value>.xhtml</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>com.sun.faces.disableVersionTracking</param-name>
             <param-value>true</param-value>
           </context-param>
           
           <context-param>
              <param-name>com.sun.faces.enableRestoreView11Compatibility</param-name>
              <param-value>true</param-value>
           </context-param>
           
           <context-param>
                <param-name>javax.faces.CONFIG_FILES</param-name>
                <param-value>/WEB-INF/faces-managed-beans.xml, /WEB-INF/faces-navigation.xml</param-value>
           </context-param>
           
           <context-param>
                <param-name>org.richfaces.queue.global.enabled</param-name>
                <param-value>true</param-value>
           </context-param>
           
           <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>
           
           <context-param>
                <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
                <param-value>false</param-value>
           </context-param>
           
           <context-param>
                <param-name>facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE</param-name>
                <param-value>false</param-value>
           </context-param>
           
           <context-param>
                <param-name>facelets.BUILD_BEFORE_RESTORE</param-name>
                <param-value>false</param-value>
           </context-param>
           
           <context-param>
                <param-name>facelets.DEVELOPMENT</param-name>
                <param-value>false</param-value>
           </context-param>
           
           <context-param>
                <param-name>facelets.REFRESH_PERIOD</param-name>
                <param-value>1</param-value>
           </context-param>
           
           <context-param>
                <param-name>com.sun.faces.responseBufferSize</param-name>
                <param-value>500000</param-value>
           </context-param>
           
           <context-param>
                <param-name>com.sun.faces.verifyObjects</param-name>
                <param-value>false</param-value>
           </context-param>
           
           <context-param>
                <param-name>com.sun.faces.externalizeJavaScript</param-name>
                <param-value>true</param-value>
           </context-param>
           
           <context-param>
                <param-name>com.sun.faces.serializationProvider</param-name>
                <param-value>org.jboss.web.jsf.integration.serialization.JBossSerializationProvider</param-value>
           </context-param>
           
          <context-param>
               <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
                 <param-value>com.sun.facelets.FaceletViewHandler</param-value>
          </context-param>
      
           <listener>
              <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
          </listener>
           
          <listener>
                  <listener-class>uy.com.its.util.PersistenceAppListener</listener-class>
             </listener>     
             
             <!-- richfaces -->
      
          <filter>
              <display-name>RichFaces Filter</display-name>
              <filter-name>richfaces</filter-name>
              <filter-class>org.ajax4jsf.Filter</filter-class>
              <init-param>
                     <param-name>forceparser</param-name>
                     <param-value>false</param-value>
                </init-param>
                <init-param>
                     <param-name>enable-cache</param-name>
                     <param-value>true</param-value>
                </init-param>
          </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>
      
          <filter>
                <filter-name>AuthenticationFilter</filter-name>
                <filter-class>uy.com.its.util.AuthenticationFilter</filter-class>
           </filter>
           
          <filter-mapping>
                <filter-name>AuthenticationFilter</filter-name>
                <url-pattern>*.faces</url-pattern>
           </filter-mapping>
           <servlet>
                <servlet-name>Faces Servlet</servlet-name>
                <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                <load-on-startup>1</load-on-startup>
           </servlet>
      
          <session-config>
              <session-timeout>60</session-timeout>
          </session-config>
      
           <!-- Faces Servlet Mapping -->
           <servlet-mapping>
                <servlet-name>Faces Servlet</servlet-name>
                <url-pattern>*.faces</url-pattern>
           </servlet-mapping>
      
          <servlet>  
                <servlet-name>Initialize</servlet-name>   
                   <servlet-class>uy.com.its.util.timer.InitTimerService</servlet-class>   
                   <load-on-startup>1</load-on-startup>   
           </servlet>
                
           <servlet>
                <servlet-name>Chartlet</servlet-name>
                <servlet-class>net.sf.jsfcomp.chartcreator.Chartlet</servlet-class>
           </servlet>
           
           <servlet-mapping>
                <servlet-name>Chartlet</servlet-name>
                <url-pattern>*.chart</url-pattern>
           </servlet-mapping>
           
           <welcome-file-list>
                <welcome-file>/login.jsp</welcome-file>
                <welcome-file>/index.jsp</welcome-file>
                <welcome-file>/index.html</welcome-file>
           </welcome-file-list>
      
      </web-app>
      

       

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
      <display-name>ITIL Gestion de Configuracion</display-name>
      <description>ITE-ITIL</description>
      <!-- Use Documents Saved as *.xhtml -->
        
      <context-param>
      <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
      <param-value>.xhtml</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>com.sun.faces.disableVersionTracking</param-name>
      <param-value>true</param-value>
      </context-param>
      <context-param>
              <param-name>com.sun.faces.enableRestoreView11Compatibility</param-name>
              <param-value>true</param-value>
      </context-param>
      <context-param>
      <param-name>javax.faces.CONFIG_FILES</param-name>
      <param-value>/WEB-INF/faces-managed-beans.xml, /WEB-INF/faces-navigation.xml</param-value>
      </context-param>
      <context-param>
      <param-name>org.richfaces.queue.global.enabled</param-name>
      <param-value>true</param-value>
      </context-param>
      <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>
      <context-param>
      <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
      <param-value>false</param-value>
      </context-param>
      <context-param>
      <param-name>facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE</param-name>
      <param-value>false</param-value>
      </context-param>
      <context-param>
      <param-name>facelets.BUILD_BEFORE_RESTORE</param-name>
      <param-value>false</param-value>
      </context-param>
      <context-param>
      <param-name>facelets.DEVELOPMENT</param-name>
      <param-value>false</param-value>
      </context-param>
      <context-param>
      <param-name>facelets.REFRESH_PERIOD</param-name>
      <param-value>1</param-value>
      </context-param>
      <context-param>
      <param-name>com.sun.faces.responseBufferSize</param-name>
      <param-value>500000</param-value>
      </context-param>
      <context-param>
      <param-name>com.sun.faces.verifyObjects</param-name>
      <param-value>false</param-value>
      </context-param>
      <context-param>
      <param-name>com.sun.faces.externalizeJavaScript</param-name>
      <param-value>true</param-value>
      </context-param>
      <context-param>
      <param-name>com.sun.faces.serializationProvider</param-name>
      <param-value>org.jboss.web.jsf.integration.serialization.JBossSerializationProvider</param-value>
      </context-param>
          <context-param>
               <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
                 <param-value>com.sun.facelets.FaceletViewHandler</param-value>
          </context-param>
         
      <listener>
              <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
          </listener>
          <listener>
                  <listener-class>uy.com.its.util.PersistenceAppListener</listener-class>
             </listener>
       
             <!-- richfaces -->
          <filter>
              <display-name>RichFaces Filter</display-name>
              <filter-name>richfaces</filter-name>
              <filter-class>org.ajax4jsf.Filter</filter-class>
              <init-param>
      <param-name>forceparser</param-name>
      <param-value>false</param-value>
      </init-param>
      <init-param>
      <param-name>enable-cache</param-name>
      <param-value>true</param-value>
      </init-param>
          </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>
          <filter>
      <filter-name>AuthenticationFilter</filter-name>
      <filter-class>uy.com.its.util.AuthenticationFilter</filter-class>
      </filter>
          <filter-mapping>
      <filter-name>AuthenticationFilter</filter-name>
      <url-pattern>*.faces</url-pattern>
      </filter-mapping>
      <servlet>
      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
      </servlet>
          <session-config>
              <session-timeout>60</session-timeout>
          </session-config>
         
      <!-- Faces Servlet Mapping -->
      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.faces</url-pattern>
      </servlet-mapping>
          <servlet> 
      <servlet-name>Initialize</servlet-name>  
             <servlet-class>uy.com.its.util.timer.InitTimerService</servlet-class>  
             <load-on-startup>1</load-on-startup>  
      </servlet>
      <servlet>
      <servlet-name>Chartlet</servlet-name>
      <servlet-class>net.sf.jsfcomp.chartcreator.Chartlet</servlet-class>
      </servlet>
      <servlet-mapping>
      <servlet-name>Chartlet</servlet-name>
      <url-pattern>*.chart</url-pattern>
      </servlet-mapping>
      <welcome-file-list>
      <welcome-file>/login.jsp</welcome-file>
      <welcome-file>/index.jsp</welcome-file>
      <welcome-file>/index.html</welcome-file>
      </welcome-file-list>
      </web-app>
      Thanks for your time!