摘要: 在业务系统中,可能根据某个值的不同,进行不同的逻辑代码,如下: public void process(OrderDto orderDto){ int type = orderDto.getType(); if (1==type){ System.out.println("取消即时订单"); }el 阅读全文
posted @ 2019-05-27 15:21 炫舞风中 阅读(265) 评论(1) 推荐(0) 编辑
摘要: 1、在需要校验的参数名上面添加注解 2、在web层接收参数(参数前面使用@Valid进行标记,后面必须紧跟参数bindingResult,存储参数的错误信息) 3、使用aop进行校验信息统一处理 阅读全文
posted @ 2019-05-27 11:33 炫舞风中 阅读(1497) 评论(0) 推荐(0) 编辑
摘要: @Component @Slf4j public class CreateBaseDictoryListener implements ServletContextListener { @Override public void contextInitialized(ServletContextEvent sce) { log.info("========... 阅读全文
posted @ 2019-05-27 11:09 炫舞风中 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 1、在配置文件中进行配置 2、注册拦截器需要实现WebMvcConfigurer 阅读全文
posted @ 2019-05-27 11:05 炫舞风中 阅读(206) 评论(0) 推荐(0) 编辑
摘要: @Configuration public class WebMvcConfiguration implements WebMvcConfigurer { @Bean public CorsFilter corsFilter() { final UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSo... 阅读全文
posted @ 2019-05-27 11:00 炫舞风中 阅读(162) 评论(0) 推荐(0) 编辑