springmvc注解配置两种都用哪个先执行
1个回答
推荐于2016-08-27
展开全部
java代码:
package cn.javass.spring.chapter12;
//省略import
public class ComponentDefinitionWithAnnotationTest {
private static String configLocation = "classpath:chapter12/componentDefinitionWithAnnotation.xml";
private static ApplicationContext ctx = new ClassPathXmlApplicationContext(configLocation);
@Test
public void testComponent() {
TestCompoment component = ctx.getBean("component", TestCompoment.class);
Assert.assertNotNull(component.getCtx());
}
}
package cn.javass.spring.chapter12;
//省略import
public class ComponentDefinitionWithAnnotationTest {
private static String configLocation = "classpath:chapter12/componentDefinitionWithAnnotation.xml";
private static ApplicationContext ctx = new ClassPathXmlApplicationContext(configLocation);
@Test
public void testComponent() {
TestCompoment component = ctx.getBean("component", TestCompoment.class);
Assert.assertNotNull(component.getCtx());
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询