JQuery和bootstrap报404的问题

在html页面导入的js和css的时候,不要加static这级目录,直接跳过即可,例如

导入的时候不需要加static目录,直接导入js/和css/即可

后台JAVABean的日期类,前台type=date增加报错的问题

后台错误:

Field error in object ‘user‘ on field ‘birthday‘: rejected value [2013-06-24]; codes [typeMismatch.user.birthday,typeMismatch.birthday,typeMismatch.java.util.Date,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [user.birthday,birthday]; arguments []; default message [birthday]]; default message [Failed to convert property value of type ‘java.lang.String‘ to required type ‘java.util.Date‘ for property ‘birthday‘; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type java.lang.String to type java.util.Date for value ‘2013-06-24‘; nested exception is java.lang.IllegalArgumentException]

解决办法

在对应的实体类属性上加入   @DateTimeFormat(pattern = "yyyy-MM-dd")

前台表单Action访问后台Controller,后台跳转html要用重定向

这里直接用return "html地址" 是不行的

  return "redirect:/index"; 

要用重定向。

设置SpringBoot访问localhost:8080的默认跳转页面

 这个在SpringMVC中很好设置直接在Web.xml写的东西在SpringBoot里面变得有些麻烦

这里要写一个配置类,在配置类里写入你想跳转的默认访问页面

代码如下

@Configuration
public class DefaultView extends WebMvcConfigurerAdapter {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/").setViewName("forward:/index"); //在这里写上要跳转的默认主页
registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
super.addViewControllers(registry);
}
}

数据源配置错误

这里的问题就是我们在创建SpringBoot框架的时候勾选了数据库相关的依赖,但是在启动tocmat过程中并没有配置这个数据库依赖(比如我勾选了但是没有用到数据库,只是测试一下),就会报如下图的错误

解决方法

只能在SpringBootApplication注解中加上下面这行代码,或者添加数据库配置

exclude= {DataSourceAutoConfiguration.class}

该注解的作用是,排除自动注入数据源的配置(取消数据库配置),一般使用在客户端(消费者)服务中

解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题

接口Dao的接口名与Mapper的文件名一定要一模一样。

 

 

最新文章

  1. C#2.0 特性
  2. [linux] FastDFS访问文件,400 Bad Request
  3. GraphicsMagick为图片添加水印
  4. ng-repeat 遍历同值数组导致的报错
  5. 关于初学者上传文件到github的方法
  6. 个人的IDE制作(vim)——适用于C++/C
  7. 你真的了解mysql的varchar字段的长度有多少吗?
  8. js获取当前时间戳
  9. Java基础----jdk1.8 反射实验
  10. 阿里云负载均衡SLB的文件上传下载问题解决
  11. 《java.util.concurrent 包源码阅读》25 Fork/Join框架之Fork与Work-Stealing(重写23,24)
  12. C++标准库vector类型的使用和操作总结
  13. SpringBoot使用ELK日志收集
  14. On the Optimal Approach of Survivable Virtual Network Embedding in Virtualized SDN
  15. DataGuard---->物理StandBy的角色切换之switchover
  16. caffe训练模型中断的解决办法(利用solverstate)
  17. 下一个更大的数 Next Greater Element
  18. 理解Kubernetes(2): 应用的各种访问方式
  19. 从QQ音乐开发,探讨如何利用腾讯云SDK在直播中加入视频动画
  20. Visual Studio 编译信息细度显示设置

热门文章

  1. 【每日一包0018】fecha
  2. html/css系列 BFC
  3. TensorFlow Serving实现多模型部署以及不同版本模型的调用
  4. 在Tomcat上发布Web项目的方式
  5. 使用 ALSAlib 播放 wav
  6. 在AX中解析多层的json信息
  7. 简说Python之IO
  8. 03-influxdb原理
  9. php通过单例模式使一个类只能创建一个对象。
  10. 解决Tomcat控制台输出乱码问题