运行打开网页的时候显示的页面是这个样子
跳转到此页面的时候终端会报错误:
Servlet.service() for servlet [jsp] in context with path [] threw exception [java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator] with root cause
java.lang.ClassNotFoundException: javax.servlet.jsp.tagext.TagLibraryValidator
如果spring boot是3的话,就需要把jstl的依赖替换成以下两个依赖:
<dependency>
<groupId>jakarta.servlet.jsp.jstl</groupId>
<artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jakarta.servlet.jsp.jstl</artifactId>
</dependency>
基本上就可以了
如果依赖报红导不进去大概是groupId写错了