spring配置注解和springmvc的注解有什么不同
1个回答
2014-12-07
展开全部
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());
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |