2
봄에 나는 봄 부팅(된 .java 파일) 나는 그것에 대해 어떻게 변경 구성이 부팅
을
가야 에 매핑 XML을 사용하는 프로젝트를 마이그레이션하는 건가요? 다음은이 같은 @ImportResource를 사용 @Configuration를 사용하여 구성 클래스 파일을 생성하고 .xml 파일을 가져와야합니다<bean id="repository" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jcr/myRepository"/>
</bean>
<bean id="jcrSessionFactory" class="org.springmodules.jcr.JcrSessionFactory">
<property name="repository" ref="repository" />
<property name="credentials">
<bean class="javax.jcr.SimpleCredentials">
<constructor-arg index="0" value="admin" />
<!-- create the credentials using a bean factory -->
<constructor-arg index="1">
<bean factory-bean="password" factory-method="toCharArray" />
</constructor-arg>
</bean>
</property>
</bean>
<!-- create the password to return it as a char[] -->
<bean id="password" class="java.lang.String">
<constructor-arg index="0" value="admin" />
</bean>
<bean id="jcrTemplate" class="org.springmodules.jcr.JcrTemplate">
<property name="sessionFactory" ref="jcrSessionFactory" />
<property name="allowCreate" value="true" />
</bean>
<Resource name="jcr/myRepository"
auth="Container"
type="javax.jcr.Repository"
factory="org.apache.jackrabbit.core.jndi.BindableRepositoryFactory"
configFilePath="D:/DMSRepo/repositoryFactlive.xml"
repHomeDir="D:/DMSRepo/factlivetrialVersion2/repo"/>
작은 int'class'는 클래스를 참조합니다 ... 당신은'new'로 생성 할 수있는 것들. 그것부터 시작하십시오. –