![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
解决方法
若相知丶
一个菜鸡,正在学Java后端
展开
-
记一次springboot上传文件要重启或bulid才能显示的问题
记一次springboot上传文件要重启或bulid才能显示的问题问题:Springboot文件上传功能上传图片时,前端不能很快的显示图片,每次都要上传图片后要重新build一下才能看得见上传的图片原因:这是对服务器的保护措施导致的,服务器不能对外部暴露真实的资源路径,需要配置虚拟路径映射访问。解决方法:在application.yml文件加入了静态资源文件夹:spring: #获取静态文件 resources: static-locations: - classpat原创 2021-05-03 16:02:41 · 427 阅读 · 0 评论 -
2021-02-18 笔试算法题
#2021-02-18 笔试算法题1.台阶问题/** * 走台阶问题算法 * 有x阶台阶,可以走1步,也可走2步,求有多少种走法 */public static long countSteps(int x){ if(x<=0){ return 0; }else if(x<3&&x>0){ return x; }else{ return countSteps(x-1)+countSteps(x原创 2021-02-18 16:55:26 · 151 阅读 · 0 评论 -
20210126记一次springboot转发出现的问题
记一次springboot转发出现的问题本页面的bootstrap样式没有问题,但是转发后就找不到了查询了资料后才发现我写的是相对路径,页面转发后就找不到资源文件了<link rel="stylesheet" th:href="@{css/bootstrap.min.css}"/>所以要写成绝对路径<link rel="stylesheet" th:href="@{~/css/bootstrap.min.css}"/>此时访问页面就正常了...原创 2021-01-26 11:56:02 · 181 阅读 · 0 评论 -
npm报错 TypeError [ERR_INVALID_ARG_TYPE]: The “path“ argument must be of type string.Received undefine
npm报错 TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string.Received undefined解决办法:1.修改static文件夹下的package.json里sass-loader版本"sass-loader": "^7.3.1"2.重新npm install3.npmrun dev4.遇到了新的错误Node Sass version 5.0.0 is incompatible wi原创 2020-12-23 01:49:31 · 8091 阅读 · 0 评论 -
ssm整合
SSM整合前言每次创建一个ssm项目都要到处找依赖和配置文件,所以我把自己用到过的依赖和配置文件整理了一下,放到博客供自己和大家参考。1.依赖 <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.8</maven.compiler.source>原创 2020-12-21 13:26:53 · 95 阅读 · 0 评论 -
记录一次Mybatis动态SQL中遇到的坑
问题复现xml片段<!--批量修改--> <update id="updateBatch" parameterType="list"> <foreach collection="list" item="item" index="index" separator=","> update item_category <set> <if test="i原创 2020-12-11 20:56:45 · 357 阅读 · 0 评论 -
如何在重定向的情况下向前端传数据
如何在重定向的情况下向前端传数据后端: //Spring MVC import org.springframework.web.servlet.mvc.support.RedirectAttributes; //RedirectAttributes attributes 用于接收重定向传递的数据 @PostMapping("/login") public String login(@RequestParam String username, @原创 2020-12-03 11:18:34 · 1439 阅读 · 0 评论 -
Spring Boot - Shiro整合遇到的错误(2020-11-15)
Spring Boot - Shiro整合遇到的错误(2020-11-15)1.首先创建的是一个Maven项目2.这个项目里创建了一个Module,也是一个Maven项目,这个项目能正常运行3.然后创建了一个Spring Boot项目,但是这个项目并没有自动为我们制定Source Root文件,所以需要我们收到Mark4.所有的文件夹mark后,我往Spring Boot项目的pom.xml文件导入依赖(因为导入了mysql驱动,给自己挖了一个坑)5.同样的,这里的pom.xml也需要自己右键Ad原创 2020-11-16 10:52:50 · 179 阅读 · 0 评论 -
SpringBoot学习心得(2020-11-13)
SpringBoot学习心得1.Controller里面的请求路径最好不要跟resource里的文件夹名字相同在thymeleaf中使用Restf风格传递参数时,因为使用了与文件夹相同的名字,导致怎么也不能传递参数<a class="btn btn-sm btn-primary" th:href="@{/emp/}+${emp.getId()}">编辑</a><!--template里有个文件夹名字也叫emp-->后来将名字改成了update后:<a原创 2020-11-13 22:00:24 · 615 阅读 · 0 评论 -
记一次SpringMvc无法访问静态资源的解决办法
SpringMvc无法访问静态资源以下是我找到的解决办法:web.xml<servlet-mapping> <servlet-name>dispatcherServlet</servlet-name> <!-- / 拦截所有,不包括.jsp /* 拦截所有,包括.jsp *.do 拦截所有的.do --> <url-pattern>/</url-pattern></servlet-mapping>原创 2020-10-22 21:29:09 · 208 阅读 · 0 评论