![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
springboot
小怪兽很无聊
这个作者很懒,什么都没留下…
展开
-
将Object对象转换成实体类对象
java中,如果将Object对象强转成实体类对象,可能会出现java.util.LinkedHashMap cannot be cast to 异常解决方法:利用 com.fasterxml.jackson.databind.ObjectMapper 包下的 convertValue方法可将对象转换为对应的实体类对象convertValue(Object fromValue, Class<T> toValueType)例子:/** * redisUtil.get(userInfo原创 2020-09-29 20:51:20 · 14538 阅读 · 3 评论 -
mybastis报出 Invalid bound statement (not found)的错误解决方案
如果我们的mapper.xml文件没有放置到src-main-resources下面,是不会被maven build plugin给默认扫描到的。会报: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):此时需要修改启动的模块的pom文件,在build标签里面加入:<build> <resources> <resource>原创 2020-07-20 02:03:23 · 187 阅读 · 0 评论 -
springboot定时任务之(@Scheduled)
一.基于注解来创建定时任务1.在主启动类添加:@EnableScheduling // 开启定时任务2.添加定时任务 @Scheduled(cron = "0 * 14 * * ?") public void configureTasks() { logger.info("-----------------------"); System.err.println("执行静态定时任务时间: " + LocalDateTime.now()); }原创 2020-07-09 14:12:55 · 113 阅读 · 0 评论 -
OpenFeign坑
cloud组件之(OpenFeign坑)opengin使用步骤:接口+注解(@FeignClient)主启动类加上@EnableFeignClients找错1半小时才找到!!!!!!错误写法:@Component@FeignClient(value = "CLOUD-PAYMENT-SERVICE")public interface OrderService { @GetMapping(value = "/getpaymentById/{id}") Map getpaymen原创 2020-06-17 17:30:49 · 1343 阅读 · 0 评论 -
freemarker中取Map中的list
<#list kindsMap?keys as mKey> ${mKey} <#assign item = kindsMap[mKey]> <#list item as itemValue> ${itemValue} </#list> </#list>con...原创 2020-03-28 20:53:47 · 3386 阅读 · 0 评论 -
SpringMVC上传
@RequestMapping("/ilunwenupload") public Map ilunWenUpload(@RequestParam("file") MultipartFile file, HttpServletRequest request) throws IOException { Map map = new HashMap(); Stri...原创 2019-12-21 16:37:37 · 133 阅读 · 0 评论 -
springboot拦截器
开发工具:IntelliJ IDEA1.项目结构2.@RestController public class LoginController { @RequestMapping("/loginYanZheng") public Map loginYanZheng(String login, String pwd, HttpServletRequest request) { Map map =...原创 2019-12-03 11:37:29 · 145 阅读 · 0 评论 -
控制器层RequestMapping
1.浏览器输入端口+ip访问@RequestMapping(value ={" / " , " "})原创 2019-07-01 09:44:12 · 235 阅读 · 0 评论