项目部署成功,但访问页面时报以下异常:
org.apache.jasper.JasperException: /webpage/login/login.jsp(2,0) The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88) org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:300) org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:333) org.apache.jasper.compiler.Parser.parseDirective(Parser.java:442) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1400) org.apache.jasper.compiler.Parser.parse(Parser.java:130) org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255) org.apache.jasper.compiler.ParserController.parse(ParserController.java:103) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:185) org.apache.jasper.compiler.Compiler.compile(Compiler.java:354) org.apache.jasper.compiler.Compiler.compile(Compiler.java:334) org.apache.jasper.compiler.Compiler.compile(Compiler.java:321) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:723) org.jeecgframework.core.aop.GZipFilter.doFilter(GZipFilter.java:51) com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:140) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
经检查是由于工程的WEB-INF/lib/目录下缺少jstl这个jar包,因为我是用maven,所以在pom.xm文件中增加以下配置,重新打包即可:
<dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency>
时间: 2024-10-06 06:52:02