webx.xml 4.02 KB
<?xml version="1.0" encoding="UTF-8"?>
<!-- Webx Root Context Configuration.  -->
<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:services="http://www.alibaba.com/schema/services"
             xmlns:ml-factories="http://www.alibaba.com/schema/services/module-loader/factories"
             xmlns:pull-factories="http://www.alibaba.com/schema/services/pull/factories"
             xmlns:request-contexts="http://www.alibaba.com/schema/services/request-contexts"
             xsi:schemaLocation="
                 http://www.alibaba.com/schema/services http://localhost:8080/schema/services.xsd
                 http://www.alibaba.com/schema/services/module-loader/factories http://localhost:8080/schema/services-module-loader-factories.xsd
                 http://www.alibaba.com/schema/services/pull/factories http://localhost:8080/schema/services-pull-factories.xsd
                 http://www.alibaba.com/schema/services/request-contexts http://localhost:8080/schema/services-request-contexts.xsd
                 http://www.springframework.org/schema/beans http://localhost:8080/schema/www.springframework.org/schema/beans/spring-beans.xsd
             ">

    <!-- 支持${xxx}替换。 -->
    <services:property-placeholder>
        <property key="component">common</property>
    </services:property-placeholder>
    <!-- 服务提供者生成。 -->
    <beans:import resource="classpath:/META-INF/spring/*.xml" />

    <!-- 服务提供者生成。 -->
    <beans:import resource="classpath:dubbo-web-consumer.xml" />

    <beans:import resource="classpath*:ApplicationContext.xml"/>

    <!-- 共享配置。 -->
    <beans:import resource="common/webx-component-and-root.xml" />

    <!-- 异常管道。 -->
    <beans:import resource="common/pipeline-exception.xml" />

    <!-- 资源装载。 -->
    <beans:import resource="common/resources.xml" />

    <!-- URI生成。 -->
    <beans:import resource="classpath*:/uris.xml" />

    <beans:bean id="pageMap"        class="com.xiniunet.framework.util.auth.PageMap" />
    <beans:bean id="webService"        class="com.xiniunet.web.service.Main" />
    <beans:bean id="springContext"  class="com.xiniunet.framework.util.SpringContext" />

    <!-- 综合设置。 -->
    <services:webx-configuration>
        <!-- 默认将productionMode设为true,建议在jetty插件中设置-DproductionMode=false。 -->
        <productionMode>${productionMode:true}</productionMode>
        <components defaultComponent="home" />
    </services:webx-configuration>

    <!-- 设置request/response/session。 -->
    <services:request-contexts>
        <request-contexts:basic />
        <request-contexts:buffered />
        <request-contexts:lazy-commit />
        <request-contexts:parser />
        <request-contexts:set-locale defaultLocale="zh_CN" defaultCharset="UTF-8" />
    </services:request-contexts>

    <!-- 支持上传文件。 -->
    <services:upload sizeMax="5M" />

    <!-- 将beans暴露给模板。这里定义的tools可被所有components之间共享。 -->
    <services:pull>
        <pull-factories:utils />
        <pull-factories:page-tool />
        <pull-factories:control-tool />
        <pull-factories:uris-tool />
        <pull-factories:factory id="application"    class="com.xiniunet.framework.util.auth.ApplicationTool" />
        <pull-factories:factory id="principal"      class="com.xiniunet.framework.util.auth.PrincipalTool" />
        <pull-factories:factory id="config"         class="com.xiniunet.framework.util.auth.ConfigTool" />
        <pull-factories:factory id="transfer"           class="com.xiniunet.web.tool.TransferTool" />
        <pull-factories:factory id="user"           class="com.xiniunet.web.tool.UserTool" />
    </services:pull>

    <!-- 装载模块。 -->
    <services:module-loader>
        <ml-factories:class-modules>
            <search-packages type="$1" packages="com.xiniunet.*.*.module.*" />
        </ml-factories:class-modules>
    </services:module-loader>

</beans:beans>