本博客已经转移到:www.itwps.com 此博客后续不会再更新,详情请关注一下www.itwps.com 谢谢。
SpringBoot上传文件出现的问题[持续更新]
1,controlle层注解还是要使用@Controller,自测 如果使用@RestController,2中return 页面失效
2,返回templates文件下的页面,renturn "index.html/jsp/..." ,自测不要使用retuen "index" 就完了,带上后缀
浏览器直接访问:localhost:8080/upload
@GetMapping(value = "/upload")
public String upload(){
return "index.html";
}
3,报错:Exception processing template "XXX": Error resolving template [XXX], template might not exist or might not be accessible by any of the configured Template Resolvers
其实报这个错,不影响文件上传,自测报这个错文件也是会上传成功
解决办法:在执行这个方法上面加上@ResponseBody