1. 功能介绍

    部署配置,做为系统部署时的配置,一般包括过滤器,应用访问入口,接口调用配置,JMS调用等。

  2. 部署配置

    1. 过滤器配置

      <filter>
      	<filter-name>redirect</filter-name>
      	<filter-class>org.apache.tapestry.RedirectFilter</filter-class>
      </filter>
      <filter-mapping>
      	<filter-name>redirect</filter-name>
      	<url-pattern>/</url-pattern>
      </filter-mapping>
      
    2. 附件使用配置

      <servlet>
      	<servlet-name>attach</servlet-name>
      	<servlet-class>com.linkage.component.util.file.FileServlet</servlet-class>
      </servlet>
      <servlet-mapping>
      	<servlet-name>attach</servlet-name>
      	<url-pattern>/attach</url-pattern>
      </servlet-mapping>
      
    3. 图片使用配置

      <servlet>
      	<servlet-name>image</servlet-name>
      	<servlet-class>com.linkage.component.util.file.ImageServlet</servlet-class>
      </servlet>
      <servlet-mapping>
      	<servlet-name>image</servlet-name>
      	<url-pattern>/image</url-pattern>
      </servlet-mapping>
      
    4. 应用入口配置,可以自行修改

      <servlet>
      	<servlet-name>quickstart</servlet-name>
      	<servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
      	<load-on-startup>0</load-on-startup>
      </servlet>
      <servlet-mapping>
      	<servlet-name>quickstart</servlet-name>
      	<url-pattern>/app</url-pattern>
      </servlet-mapping>
      
    5. HTTP服务发布配置(/httptran/CrmService即为发布给其他系统调用的路径)

      <servlet>
      	<servlet-name>httptran</servlet-name>
      	<servlet-class>com.linkage.wtrans.httptran.HttpServletTran</servlet-class>
      	<load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
      	<servlet-name>httptran</servlet-name>
      	<url-pattern>/httptran/CrmService</url-pattern>
      </servlet-mapping>
      
    6. WebService服务发布配置(/wstran/CrmService即为发布给其他系统调用的路径,其中CrmService为WS配置中定义)

      <servlet>
      	<servlet-name>wstran</servlet-name>
      	<servlet-class>org.codehaus.xfire.transport.http.XFireConfigurableServlet</servlet-class>
      <init-param>
      		<param-name>config</param-name>
      		<param-value>xfire/services.xml</param-value>
      </init-param>
      </servlet>
      <servlet-mapping>
      	<servlet-name>wstran</servlet-name>
      	<url-pattern>/wstran/*</url-pattern>
      </servlet-mapping>
      
    7. JMS配置

      <servlet>
      	<servlet-name>message</servlet-name>
      	<servlet-class>com.linkage.component.util.timer.MessageServlet</servlet-class>
      	<init-param>
      		<param-name>connection-factory-jndi</param-name>
      		<param-value>jms_cf_quickstart_1</param-value>
      	</init-param>
      	<init-param>
      		<param-name>queue-jndi</param-name>
      		<param-value>jms_queue_quickstart_1</param-value>
      	</init-param>
      	<init-param>
      		<param-name>threadpool-size</param-name>
      		<param-value>15</param-value>
      	</init-param>
      	<init-param>
      		<param-name>thread-priority</param-name>
      		<param-value>5</param-value>
      	</init-param>
      	<load-on-startup>1</load-on-startup>
      </servlet>
      
    8. HTTP压缩配置

      注:/app/*表示应用路径,如果weblogic.xml的root配置为/saleserv,web.xml配置为saleserv,那么/app/*要改为/saleserv/saleserv/*
      <filter>
      	<filter-name>compress</filter-name>
      	<filter-class>com.linkage.component.AppCompress</filter-class>
      </filter>
      <filter-mapping>
      	<filter-name>compress</filter-name>
      	<url-pattern>/app/*</url-pattern>
      </filter-mapping>
      

      说明:压缩前后对比:
      1. 第一次功能点整体打开(38个请求:包括页面,图片,js,css等)

        压缩前:流量:2M 时间:2.42s
        压缩后:流量:202KB 时间:3.54s
        效果:压缩比1:10 时间比:7:10
      2. 第二次功能点整体打开(1个请求:图片,js,css等都缓存,只有页面需要载入)

        压缩前:流量:7KB 时间:24ms
        压缩后:流量:33KB 时间:334ms
        效果:压缩比1:5 时间比:7:100
    9. 首页路径

      <welcome-file-list>
      	<welcome-file>app</welcome-file>
      </welcome-file-list>