/cart.jsp (line: [32], column: [45]) The JSP specification requires that an attribute name is preced

Posted web攻城狮鸭

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了/cart.jsp (line: [32], column: [45]) The JSP specification requires that an attribute name is preced相关的知识,希望对你有一定的参考价值。

出现的错误:

Type Exception Report

Message /cart.jsp (line: [32], column: [45]) The JSP specification requires that an attribute name is preceded by whitespace

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

org.apache.jasper.JasperException: /cart.jsp (line: [32], column: [45]) The JSP specification requires that an attribute name is preceded by whitespace
	org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:41)
	org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:291)
	org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:97)
	org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:170)
	org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:159)
	org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1251)
	org.apache.jasper.compiler.Parser.parseElements(Parser.java:1470)
	org.apache.jasper.compiler.Parser.parse(Parser.java:144)
	org.apache.jasper.compiler.ParserController.doParse(ParserController.java:244)
	org.apache.jasper.compiler.ParserController.parse(ParserController.java:105)
	org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:202)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:350)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:595)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:399)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Note The full stack trace of the root cause is available in the server logs.

出现错误的代码:

<c:forEach items="${order.map}"var="item"> 

原因:"${order.map}"的后面,var的前面要有空格;但是这种错误有时才会出现,有时不会出现。

总结:jstl 的语句没有html那么有随意性,当出现jstl语句错误时 ,应该要查询官方文档,或者很难在小细节中发现错误

 

 

还有一种情况是${order.map }"  里面的map后面不能有空格否则也会出现错误;

 

以上是关于/cart.jsp (line: [32], column: [45]) The JSP specification requires that an attribute name is preced的主要内容,如果未能解决你的问题,请参考以下文章

Python 2.6 安装wxPython后提示"64.....32"错误解决办法

git ------ fatal: No configured push destination. Either specify the URL from the command-line or co

在不同数据维度上评估模型

改动购物项图书数量的Ajax处理

text-decorationtext-decoration-colortext-decoration-linetext-decoration-style属性

logstash的性能测试