From:一条被猫抛弃的他乡流浪狗!

随笔分类 -  spring

摘要:1.web.xml配置如下 关键是41-52行 2.控制器controller 要有对应的 @RequestMapping("/index") 即可. 3.如何直接通过域名访问 如果要发布到服务器,不带项目名访问,把项目打包成ROOT.war,放到webapps下即可. ROOT里面直接是资源文件和 阅读全文
posted @ 2018-10-16 22:43 ICE_Inspire 阅读(1125) 评论(0) 推荐(0)
摘要:1.Mybatis-Generator下载 地址:https://github.com/mybatis/generator/releases 我使用的是 mybatis-generator-core-1.3.7 2.配置generatorConfig.xml 官网: http://www.mybat 阅读全文
posted @ 2018-10-05 13:54 ICE_Inspire 阅读(392) 评论(0) 推荐(1)
摘要:1.引入依赖 2.在springmvc-config.xml增加mybatis配置 3.在classpath:mapper/ 创建CustomerMapper.xml 注意创建的位置,是在上面设置的 mapperLocations. 4.创建CustomerMapper.xml对应的Customer 阅读全文
posted @ 2018-10-05 12:28 ICE_Inspire 阅读(347) 评论(0) 推荐(0)
摘要:核心是让SessionFactory由Spring管理 1.引入依赖 2.配置 springmvc-config.xml 重点是 dataSource和sessionFactory. 3.建立 *.hbm.xml和实体类Customer mapping:Customer.hbm.xml,model: 阅读全文
posted @ 2018-10-04 11:33 ICE_Inspire 阅读(459) 评论(0) 推荐(0)
摘要:1.建立project / module 新建空的project:springMvcStudy 新建module:type maven-webapp,名字mvcStudy 2.为module设置Sources和Resources 在mvcStudy/src/main下新建2个文件夹:java,res 阅读全文
posted @ 2018-10-01 11:59 ICE_Inspire 阅读(538) 评论(0) 推荐(0)
摘要:1.导包(略) 2.applicationContext.xml如下: 3.@Component 写法一: User类 main方法: 写法二: User类 main方法: 4.其他注解 @Repository@Service@Controller 这三个注解跟Component一个效果@Scope 阅读全文
posted @ 2018-09-29 22:28 ICE_Inspire 阅读(206) 评论(0) 推荐(0)
摘要:文档: https://docs.spring.io/spring/docs/5.0.9.RELEASE/spring-framework-reference/core.html#beans-factory-metadata 包下载的位置 http://repo.spring.io/release/ 阅读全文
posted @ 2018-09-28 22:50 ICE_Inspire 阅读(370) 评论(0) 推荐(0)