/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后面不能有空格否则也会出现错误;

 

转载于:https://www.cnblogs.com/czc268/p/10667070.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值