• 资料索引


    EditPlus注册码在线生成

    [转] http://www.jb51.net/tools/editplus/

    SSL安全认证配置--web.xml

    <!-- 此处配置需要强制走SSL安全认证的请求或资源,即使用HTTPS访问URL -->
    <security-constraint> 
       <web-resource-collection> 
          <web-resource-name>My-Secure-App</web-resource-name> 
          <url-pattern>/*</url-pattern> 
       </web-resource-collection> 
       <user-data-constraint> 
          <transport-guarantee>CONFIDENTIAL</transport-guarantee> 
       </user-data-constraint> 
    </security-constraint> 

    在Spring项目中,你可能需要从properties文件中读入配置注入到bean中,例如数据库连接信息,memcached server的地址端口信息等,

    这些配置信息最好独立于jar包或者war包,这样便于修改配置。Spring提供了PropertyPlaceholderConfigurer类来处理这件事情。

    [转] http://outofmemory.cn/code-snippet/3708/spring-properties-file-location

    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" lazy-init="true">
        <!-- SYSTEM_PROPERTIES_MODE_OVERRIDE这意味着可以从jvm虚拟机的参数中获得配置信息 -->
        <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
        <!-- value="true" == properties文件如果找不到的话,就可以忽略找不到的文件 -->
        <property name="ignoreResourceNotFound" value="true" />
        <property name="locations">
            <list>
               <value>classpath:/buffalo-service.properties</value>
            </list>
        </property>
    </bean>

    XFire combine with Spring --The first Configuration

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
    
        <!-- basic configuration -->
        <!-- 若是web.xml已经配置了org/codehaus/xfire/spring/xfire.xml,这里就不需要配置了 -->
        <!-- <import resource="classpath:org/codehaus/xfire/spring/xfire.xml" /> -->
        
        <!-- Service实现类-->
        <bean id="myImpl" class="webjar.foo.MyDispatcherServletXFireImpl" />
    
        <!-- XFire发布服务核心处理类的配置 -->
        <bean id="MyExporter" class="org.codehaus.xfire.spring.remoting.XFireExporter">
            <property name="serviceFactory" ref="xfire.serviceFactory" />
            <!-- Service实现类 -->
            <property name="serviceBean" ref="myImpl" />
            <!-- Service接口 -->
            <property name="serviceClass" value="webjar.foo.MyDispatcherServletXFire" />
        </bean>
        
        <!-- 结合web.xml配置的DispatcherServlet,配置对外开放的服务访问名称 -->
        <bean
            class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
            <property name="urlMap">
                <map>
                    <!-- 客户端访问时使用key的值(IWebJarService)进行调用,而不是MyExporter -->
                    <entry key="/IWebJarService">
                        <ref bean="MyExporter" />
                    </entry>
                </map>
            </property>
        </bean>
    </beans>

    XFire combine with Spring --The second Configuration {recommend}

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
    
        <!-- basic configuration -->
        <!-- 若是web.xml已经配置了org/codehaus/xfire/spring/xfire.xml,这里就不需要配置了 -->
        <!-- <import resource="classpath:org/codehaus/xfire/spring/xfire.xml" /> -->
        
        <!-- Service实现类-->
        <bean id="myImpl" class="webjar.foo.MyDispatcherServletXFireImpl" />
    
        <!-- XFire发布服务核心处理类的配置 -->
        <bean name="/IWebJarService" class="org.codehaus.xfire.spring.remoting.XFireExporter">
            <property name="serviceFactory" ref="xfire.serviceFactory" />
            <!-- Service实现类 -->
            <property name="serviceBean" ref="myImpl" />
            <!-- Service接口 -->
            <property name="serviceClass" value="webjar.foo.MyDispatcherServletXFire" />
        </bean>
    </beans>
  • 相关阅读:
    SQL Server 删除重复数据只保留一条
    英语冠词有哪些?
    英语基本语法
    统一身份认证服务(客户端用户身份验证)
    解决MVC中使用BundleConfig.RegisterBundles引用Css及js文件发布后丢失的问题
    统一身份认证服务 源码(客户端)
    MVC 如何设定默认默认路由为指定的Area下的某个action(笔记)
    MongoDB安装笔记
    消息队列第二篇:MessageQueue实战(课程订单)
    消息队列第一篇:MessageQueue介绍
  • 原文地址:https://www.cnblogs.com/maven-chao/p/5137263.html
Copyright © 2020-2023  润新知