摘要: ​1. 在开发中会遇到要把项目部署到不同的环境,一般把项目部署到服务器上,需要改数据库配置,redis配置等等,这个时候如果只有一套配置文件,那部署前要把配置文件里的路径,ip都要改一遍,这样人工的修改难免会出现漏改,错改的情况,再遇到集群部署,分布式部署,一错再改就不好改了,所以自然想到如果可以有 阅读全文
posted @ 2020-02-22 22:16 codedot 阅读(571) 评论(0) 推荐(0) 编辑
摘要: Spring对数据库的操作在jdbc上面做了深层次的封装,提供了JdbcTemplate模板。 传统Jdbc API与Spring jdbcTemplate比较: //JDBC API Statement statement = conn.createStatement(); ResultSet r 阅读全文
posted @ 2020-02-22 22:07 codedot 阅读(6988) 评论(1) 推荐(4) 编辑
摘要: 注意:springboot不推荐使用jsp。 一、引入依赖 <!-- 核心启动器, 包括auto-configuration、logging and YAML --> <dependency> <groupId>org.springframework.boot</groupId> <artifact 阅读全文
posted @ 2020-02-22 21:04 codedot 阅读(1044) 评论(0) 推荐(1) 编辑
摘要: 在传统的web开发时,我们创建一个Filter,需要在web.xml里做配置: <filter> <filter-name>FirstFilter</filter-name> <filter-class>com.linhw.demo.filter.MyFirstFilter</filter-clas 阅读全文
posted @ 2020-02-22 19:32 codedot 阅读(382) 评论(0) 推荐(0) 编辑
摘要: 在传统的web开发时,我们创建一个Listener,需要在web.xml里做配置: <listener> <listener-class>com.linhw.demo.listener.MyFirstListener</listener-class> </listener> 这样每新增一个Liste 阅读全文
posted @ 2020-02-22 17:52 codedot 阅读(585) 评论(0) 推荐(0) 编辑
摘要: 在传统的Servlet开发时,我们创建一个Servlet,需要在web.xml里做配置: <servlet> <servlet-name>FirstServlet</servlet-name> <servlet-class>com.linhw.demo.servlet.MyFirstServlet< 阅读全文
posted @ 2020-02-22 16:54 codedot 阅读(376) 评论(0) 推荐(0) 编辑
摘要: 一、引入依赖 <!-- 核心启动器, 包括auto-configuration、logging and YAML --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter< 阅读全文
posted @ 2020-02-22 16:20 codedot 阅读(772) 评论(0) 推荐(0) 编辑
摘要: 官网文档:https://docs.spring.io/spring-boot/docs/2.3.3.RELEASE/reference/htmlsingle/#using-boot-starter <!-- 核心启动器, 包括auto-configuration、logging and YAML 阅读全文
posted @ 2020-02-22 12:55 codedot 阅读(282) 评论(0) 推荐(0) 编辑