将xml的配置更改为spring引导
我正在迁移一个项目,该项目使用xml映射到spring boot(.java文件) 我该怎么做呢?下面是jackrabbit的xml配置将xml的配置更改为spring引导,xml,spring-boot,migration,jackrabbit,Xml,Spring Boot,Migration,Jackrabbit,我正在迁移一个项目,该项目使用xml映射到spring boot(.java文件) 我该怎么做呢?下面是jackrabbit的xml配置 <bean id="repository" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="java:comp/env/jcr/myRepository"/> </bean> <be
<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"/>
首先,您应该使用@configuration创建一个配置类文件,并使用@ImportResource导入.xml文件,如下所示:-
@Configuration
@ImportResource("classpath:dmsRepository.xml")
public class JackRabbitRepository {
}
然后,您必须将资源内容保存在server.xml文件中,因为它在当前xml中无法工作。在此之后,您的JackRabbit配置完成。
然后在DMS中执行您想要执行的操作。Small int
class
引用一个类。。。您可以使用new
创建这些内容。从那开始。