zoukankan      html  css  js  c++  java
  • 资料索引

    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>
  • 相关阅读:
    【剑指offer】把字符串转换成整数
    【剑指offer】不用加减乘除做加法
    【剑指offer】求1+2+3+...+n
    【剑指offer】孩子们的游戏(圆圈中最后剩下的数)
    【剑指offer】扑克牌顺子
    【剑指offer】翻转单词顺序列
    【剑指offer】左旋转字符串
    【剑指offer】和为S的两个数字
    【剑指offer】和为S的连续正数序列
    2019.1.10 Mac安装Nginx服务器
  • 原文地址:https://www.cnblogs.com/maven-chao/p/5137263.html
Copyright © 2011-2022 走看看