JSP placeholder=""不明原因的报错问题求解释

问题代码:

<div class="form-group">
    <label class="control-label">备注</label>
    <form:textarea path="remarks" htmlEscape="false" class="form-control" rows="3" placeholder=""></form:textarea>
</div>

错误提示:
Caused by: org.apache.jasper.JasperException: Unable to compile class for JSP
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:672)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
... 64 more
Caused by: java.util.NoSuchElementException
at java.util.ArrayList$Itr.next(Unknown Source)
at org.apache.jasper.compiler.Validator$ValidateVisitor.getJspAttribute(Validator.java:1385)
at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1262)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:876)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1538)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2377)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2429)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:895)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1538)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2377)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2429)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2435)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:474)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2377)
at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1841)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:217)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)
... 65 more

问题原因:只要把 placeholder="" 修改为placeholder=" "就不会报错,而且这个并不是所有人都会报错 同样的代码有的报错有的不报,自己思考的或许是tomcat或者jdk的问题单不明白具体原因请大神赐教

2个回答

1.浏览器兼容问题。
2.placeholder 属性适用于以下的 类型:text, search, url, telephone, email 以及 password。

今天也遇到这种情况,求解

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问