
spring boot
文章平均质量分 89
菜菜的中年程序猿
热爱编程的2B小青年
展开
-
使用idea spring boot整合freemarker实例
step 1 新建web工程step 2 pom依赖step 3 application.yml配置文件step 4 新建HelloWorldController 类step 5 新建ftl文件step 6 启动工程 访问路径由于spring 官方对于spring boot 不推荐使用jsp,本例实例演示spring boot 整合ftl,即freemarkerstep 1 新建web工程...原创 2019-07-15 00:24:15 · 2933 阅读 · 3 评论 -
spring boot从properties配置文件中读取中文乱码问题处理
在初步搭建spring boot项目时student.properties 配置文件中有如下中文student.name: 小楼昨夜又东风student.age: 芳龄18然后启动类中读取到页面请求以及控制台打印都是如下乱码;@RestController@SpringBootApplication@EnableConfigurationProperties(StudentDto...原创 2019-07-10 23:26:09 · 7800 阅读 · 4 评论 -
spring boot 整合thymeleaf实例演示
step1 pom依赖step2 application.yml配置文件step3 HelloWorldController 类 代码step4 新建 hello.html 页面step 5 启动工程访问工程结构图我们在上篇文章 https://blog.youkuaiyun.com/whandgdh/article/details/95937078spring boot 整合freemarker实例基...原创 2019-07-15 23:26:14 · 512 阅读 · 0 评论 -
spring boot整合jsp报错 Whitelabel Error Page 500或者404 问题处理
在刚刚用idea创建的spring boot 项目整合jsp时,一直不能正常访问,报错信息如下图There was an unexpected error (type=Internal Server Error, status=500).根据错误提示说是返回的视图名与路径名重复,来看controller类代码@Controllerpublic class HelloController...原创 2019-07-11 23:50:11 · 6506 阅读 · 1 评论 -
spring boot使用EnableWebMvc注解 无法正常加载静态页面问题 以及No ServletContext set问题解决
今天在升级项目jar包时,由于提示Caused by: java.lang.IllegalStateException: No ServletContext set 错误。就把WebMvcConfigurer 类加上了注解EnableWebMvc,如下图,项目不在报错但是项目启动后,访问网页如下图所有的静态资源都不见了,CSS样式,背景图片等后面找了很久才找到原因:@Enabl...原创 2019-07-23 23:19:28 · 9037 阅读 · 0 评论 -
spring boot + mybatis+freemarker +mysql 实例演示
step 1 新建工程选择 spring boot devtools ,等同于下面引入 devtools依赖包<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> ...原创 2019-07-17 22:18:46 · 1161 阅读 · 1 评论 -
spring boot + mybatis + freemarker + oracle 实例
step 1 新建工程 ,不再赘述step2 pom 依赖引入step 3 application.yml配置文件step 4 新建ftl 页面文件step 5 在数据库中创建emp 表step 6 user 相关代码step 7 创建EmpMapper 映射文件step 8 启动工程 访问页面总结继上篇 spring boot 整合 mysql 后 ,本例继续spring boot 整合...原创 2019-07-17 23:55:16 · 677 阅读 · 0 评论 -
spring boot shiro redis 整合Realm身份验证 报ClassCastException问题处理
今天在做项目整合Realm验证时,报ClassCastException异常,java.lang.ClassCastException: com.sinosoft.realm.AuthRealm$ShiroUser cannot be cast to com.sinosoft.realm.AuthRealm$ShiroUser在网上找了许久,不知从何下手,有人说是热部署问题,需要把热部署删...原创 2019-07-23 00:09:47 · 672 阅读 · 0 评论 -
mybatis整合oracle时对于空值报错 Error setting null for parameter # with JdbcType OTHER解决
因为mysql比较灵活,现在springboot项目中集成数据库几乎都是采用mysql,由于公司项目需要,任然采用oralce数据库,在开发时遇到下面问题。Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #17 with JdbcType OTHER, Try setting a di...原创 2019-08-15 23:53:53 · 27147 阅读 · 3 评论