Springmvc

    2019年06月08日 字数:667

SpringMVC

dispatcherServlet

dispatcherServlet 拦截规则中的请求,发送到目标 controller 处理请求. Spring 支持 xml 和注解两种配置方式。 ApplicationContext 对象,代表 Spring 控制翻转容器, org.springframework.context.ApplicationContext 接口有多个实现: ClassPathXmlApplicationContext 和 FileSystemXmlApplicationContext,两者都需要 至少有一个 beans 的 XML 文件,

ApplicationContext ctx = new ClassPathXmlApplicationContext(new String[]{"config1.xml","config2.xml"});
Product product = ctx.getBean("product",Product.class); // id 为 product,且类型为 Product 的 bean 对象.

ApplicationContext ctx =

请我喝杯咖啡

取消

感谢您的支持,我会继续写出更优秀的文章!

扫码支持
扫码支持
请我喝杯咖啡

打开微信扫一扫,即可进行扫码打赏哦

comments powered by Disqus