SpringBoot学习Demo
2017-11-19 11:11
204 查看
SpringMVC配置文件整的崩溃,周末尝试一下SpringBoot
官网Demo:http://start.spring.io/
比较好的教程:https://www.cnblogs.com/ityouknow/p/5662753.html
项目结构就如官网demo
我是如此
不过SpringBoot默认html,jsp怕是需要再走一波配置,
完成以后,右键项目,run as application,启动,返回json很easy
坑在返回页面,需要加一个模板依赖,坑到半夜
https://gitee.com/Damionew/spr.git
官网Demo:http://start.spring.io/
比较好的教程:https://www.cnblogs.com/ityouknow/p/5662753.html
项目结构就如官网demo
我是如此
不过SpringBoot默认html,jsp怕是需要再走一波配置,
完成以后,右键项目,run as application,启动,返回json很easy
坑在返回页面,需要加一个模板依赖,坑到半夜
<properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <!-- Inherit defaults from Spring Boot --> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.4.0.RELEASE</version> </parent> <!-- Add typical dependencies for a web application --> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!-- 热启动配置 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <!-- 事务管理器,自动注入DataSourceTransactionManager --> <!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> --> </dependencies> <build> <finalName>website</finalName> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <!-- 热启动配置 --> <configuration> <fork>true</fork> </configuration> </plugin> </plugins> </build>
<!-- 模板依赖 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>慢慢养成一个习惯,写好demo就往码云扔,以后要用直接拖下来,贼方便
https://gitee.com/Damionew/spr.git
相关文章推荐
- mybatis3.X入门学习demo
- ApiDemo学习之CreateBitmap以及 Paint类介绍
- Vue.js学习系列二 —— vuex学习实践笔记(附DEMO)
- ASP.NET ZERO 学习 —— (19) 应用开发Demo之多租户
- 【深度学习】用CPU运行faster-RCNN 的官方demo(基于ubuntu16.04系统)
- IOS学习:在一个UIViewController中实现侧边菜单的思路及demo
- C# 委托 事件 学习 以及 小DEMO
- 【RequireJS 学习笔记】RequireJS 学习笔记 2 —— RequireJS 版 页码切换demo 分类: javascript js jquery RequireJS js代码切换 2015-08-06 11:18 1人阅读 评论(
- spring学习----aop配置demo
- Hibernate学习(1):查询demo
- Android学习小Demo(4)贝塞尔曲线跟翻页效果
- Hibernate学习(2):添加demo
- 【FacebookSDK学习笔记】Facebook官方Demo例子简单分析
- unity官方demo学习之Stealth(十三)摄像机跟踪
- SpringBoot学习笔记(四):SpringApplication的旅途
- springboot学习笔记5(JPA 实现分页、排序、返回map集合)
- Elasticsearch5和head最新插件学习,JavaAPI demo
- SpringBoot学习(六)--SpringBoot集成swagger在线API文档工具
- java WEB学习笔记32:HttpSession 接口常用方法 及 HttpServletRequest接口中的Session方法 Demo
- apidemo 学习 CreateBitmap DensityActivity ShapeDrawable1 FingerPaint