
spring
凌渊阁
阅读世界,阅读自己。
展开
-
spring框架使用在非web架构项目中
spring有多个实例化的入口,其中一个为以下:ApplicationContext act = new ClassPathXmlApplicationContext("application-context.xml"); JdbcTemplate jdbcTemplate = (JdbcTemplate) act.getBean("jdbcTemplate");如果在非web项目中使用spr...原创 2018-04-25 15:44:52 · 3793 阅读 · 0 评论 -
使用java代码启动spring MVC
package cn.mg25.local.config; import org.springframework.context.annotation.Configuration; import org.springframework.web.filter.CharacterEncodingFilter; import org.springframework.web.servlet.suppo...原创 2018-09-20 10:50:10 · 372 阅读 · 0 评论 -
SpingMVC Controller接收参数的三种方式
Controller的方法中,可以接受的参数有: 1. @PathVariable("paramName") String paramName 2. @RequestMapping(value="/app/{paramName}/index",produces="application/json;charset=UTF-8") 3. @RequestParam(required=false) ...原创 2019-03-05 20:32:42 · 252 阅读 · 0 评论