spring xsd usage

http://docs.spring.io/spring-framework/docs/current/spring-framework-reference/html/xsd-config.html

 

factorybean:

 <bean id="jacksonFactory" class="com.toon.web.commons.spring.jackson.JacksonFactory"/>

 <bean id="objectMapper" factory-bean="jacksonFactory" factory-method="getObjectMapper" />

 

construct:

<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">

<constructor-arg name="objectMapper" type="com.fasterxml.jackson.databind.ObjectMapper" ref="objectMapper">

</constructor-arg>

</bean>

 

注入静态变量:

<bean id="..." class="...">
    <property name="isolation">
        <bean id="java.sql.Connection.TRANSACTION_SERIALIZABLE"
                class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean" />
    </property>
</bean>
或: <bean id="..." class="...">
    <property name="isolation">
        <util:constant static-field="java.sql.Connection.TRANSACTION_SERIALIZABLE"/>
    </property>
</bean>

你可能感兴趣的:(spring)