org.apache.jasper.JasperException: /pages/path.jsp

时间:2021-03-16 15:08:25

1、错误描述

三月 15, 2015 8:56:37 下午 org.apache.jasper.compiler.TldLocationsCache tldScanJar
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
三月 15, 2015 8:56:38 下午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [jsp] in context with path [/SSH] threw exception [/pages/path.jsp (line: 11, column: 0) According to TLD or attribute directive in tag file, attribute value does not accept any expressions] with root cause
org.apache.jasper.JasperException: /pages/path.jsp (line: 11, column: 0) According to TLD or attribute directive in tag file, attribute value does not accept any expressions
	at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
	at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:443)
	at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:149)
	at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1241)
	at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:876)
	at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1553)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2444)
	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2450)
	at org.apache.jasper.compiler.Node$Root.accept(Node.java:474)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2444)
	at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:536)
	at org.apache.jasper.compiler.Node$IncludeDirective.accept(Node.java:653)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2444)
	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2450)
	at org.apache.jasper.compiler.Node$Root.accept(Node.java:474)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392)
	at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1845)
	at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:218)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:374)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:341)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.doFilter(StrutsPrepareFilter.java:91)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

2、错误原因

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
<%@ taglib prefix="m" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<c:set var="bp" value="<%=basePath%>"></c:set>
<c:set var="pa" value="<%=path%>"></c:set>

由于“<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>”,导入出错

3、解决办法

将“<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>”修改成“<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>”