jsp连接mysql显示404,SpringBoot+jsp项目启动出现404的解决方法
通過maven創(chuàng)建springboot項(xiàng)目啟動(dòng)出現(xiàn)404
application.properties配置
spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=.jsp
項(xiàng)目結(jié)構(gòu)
控制器方法
package com.example.demo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class IndexController {
@RequestMapping("/")
public String index() {
return "index";
}
}
啟動(dòng)項(xiàng)目訪問localhost:8080,出現(xiàn)404
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Thu Feb 28 22:59:29 CST 2019
There was an unexpected error (type=Not Found, status=404).
No message available
解決方法
pom.xml添加依賴
org.apache.tomcat.embed
tomcat-embed-jasper
javax.servlet
jstl
clean并刷新maven
重啟并訪問localhost:8080
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
總結(jié)
以上是生活随笔為你收集整理的jsp连接mysql显示404,SpringBoot+jsp项目启动出现404的解决方法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 中文字符串函数php,php截取中文字符
- 下一篇: oracle分片键,数据库SQL语句及性