SpringBootSpringBoot CommandLineRunner详解 在使用SpringBoot构建项目时,我们通常有一些预先数据的加载。那么SpringBoot提供了一个简单的方式来实现–CommandLineRunner。 CommandLineRunner是一个接... 2018年10月15日 浏览量:736 次 发表评论 阅读全文
eclipseeclipse中使用maven将springboot项目打成war包 1.pom.xml里指定为war <packaging>war</packaging> 2.WebApplication.java里加上以下代码 @Override prote... 2018年9月28日 浏览量:1,238 次 发表评论 阅读全文
SpringBoot里获取出错项目的项目名和错误消息 List err = result.getFieldErrors(); FieldError fe; String field; String errorMessage; for (int i = 0... 2018年8月31日 SpringBoot 浏览量:700 次 发表评论 阅读全文
SpringBoot自定义check注解 @Target({ ElementType.TYPE, ElementType.FIELD }) @Retention(RetentionPolicy.RUNTIME) @Constraint(val... 2018年8月29日 SpringBoot 浏览量:1,238 次 发表评论 阅读全文
SpringBoot里多个url对应一个方法 写法如下: @RequestMapping(value = { "{prodNo}/detail", "{prodNo}/{stationNo}/detail" }) public ModelAndV... 2018年8月23日 SpringBoot 浏览量:1,328 次 发表评论 阅读全文
SpringBoot以form形式接受单值 controller里: @PostMapping("{prodNo}/edit") @RequestMapping(value = "/{prodNo}/edit", method = { Requ... 2018年8月21日 SpringBoot 浏览量:869 次 发表评论 阅读全文
SpringBoot form submit时后台接受不到值 今天项目中发现form submit时后台接受不到值,看了下工程里的代码发现,共通里自定义了一个@BindField注解,加上这个注解后值就能正常接受了,但是印象中Spring是可以自动接受值的,看了... 2018年8月9日 SpringBoot 浏览量:1,036 次 发表评论 阅读全文
SpringBoot conflicts with existing, non-compatible bean definition of same name and class 的解决办法 Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-spe... 2018年8月8日 SpringBoot 浏览量:5,791 次 发表评论 阅读全文