1、导入相关依赖 (存在jsp页面下载问题,可能是缺少tomcat-embed-jasper的依赖对jsp的支持)<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-star
原创
2022-08-31 18:11:13
149阅读
看看jar包是否都引入: <!--springboot集成jsp--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </dep ...
转载
2021-08-04 13:26:00
513阅读
2评论
第一步:添加 jsp相关依赖<!-- servlet,jsp --> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> </dependency> <dep...
1.springboot新建webapp文件夹此时webapp是灰色的,需要重新设置下才能正常访问2配置jspspring: mvc: view: prefix: /WEB-INF/jsp/ suffix: .jsp3.新建jsp4.启动项目成功访问...
原创
2021-10-29 09:28:12
319阅读
在Intellij里,建立一个项目,然后再建立模块,在模块里无法访问jsp页面。处理方法为: 在配置文件里,选择working directory 填写 $MODULE_DIR$ ,亲测有效 ...
转载
2021-10-20 17:09:00
275阅读
2评论
大家好,我是雄雄,欢迎关注微信公众号【雄雄的小课堂】。前言大家在写springboot的时候不知道你们遇没遇到过这样的问题,当我们满怀信心的在浏览器中输入:localhost://8080...
原创
2021-03-02 06:00:00
1533阅读
配置WebConfig处理静态资源映射@Slf4j
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
// addResou
转载
2021-04-03 07:18:27
644阅读
2评论
pom.xml中添加:<dependency> <groupId>org.springframework.boot</groupId>
在使用SpringBoot向的时候会遇到访问WEB-INF下的jsp页面找不到的情况如下图是我的配置访问的时候如下遇到这种情况需要在maven中加入下面的代码,把webapp转装成资源目录
原创
2021-11-26 13:47:18
683阅读
点赞
一、项目的打包,在pom.xml加入`` &lt;build&gt; &lt;finalName&gt;UeditorAndSB&lt;/finalName&gt; &lt;plugins&gt;
原创
2018-08-10 16:27:35
860阅读
搭建springboot项目在新建的页面引入jquery,报404,找不到js文件。作为一名后端,对于这个问题,我也是很Dan疼,虽然知道这是被内置的springmvc给拦截了,没放行。可是springboot不熟悉,一顿乱配,毛用没有。经过我这面向百度编程的深厚功底,最终还是找到了答案。1. 确保的你引入的js格式 type 和 <script></script>...
原创
2021-07-12 17:05:19
2431阅读
springboot访问不到静态资源,查看如下生成classes中是否有文件如果没有,则clean一下,再编译
原创
2022-03-24 10:19:53
416阅读
前提场景:以前的大量web项目是用jsp写的,改到springcloud中templates中不支持jsp网页。1.在resources同级目录下新建一个webapp2.到Project Settings->Modules->Web下把webapp路径添加进去3.在pom.xml添加jsp支持 1 <!-- jsp支持-->
2 <
原创
2020-08-10 11:45:20
1242阅读
springboot中如果想访问html页面,不每访问一个页面就写一个Controller,可以统一写一个公共的controller方法 代码: (1)引入hutool工具依赖 <!-- hutool工具包--><dependency> <groupId>com.xiaoleilu</groupId
转载
2020-06-13 16:22:00
195阅读
2评论
一般我们在启动项目时,会有一个欢迎页,如下: <welcome-file-list> <welcome-file>index.html</welcome-file>
转载
2022-06-02 17:49:18
770阅读
问题:搭建springboot, 前端页面使用jsp,访问controller报错信息:This application has no explicit mapping for /error, so you are seeing this as a fallback.
Thu May 03 10:21:54 CST 2018
There was an unexpected
spring boot访问页面需要thymeleaf模板依赖在pom文件中引入<dependency> <groupId>org.springframework.boot</grouprtifactId>&l...