1. 程式人生 > >報錯:The JSP specification requires that attribute

報錯:The JSP specification requires that attribute

line ror cat exceptio tex runt epo org char

The JSP specification requires that an attribute name is preceded by whitespace
翻譯成中文:JSP規範要求屬性名稱前面有空白。
報錯全文信息:
type Exception report

message /foreground/common/link.jsp (line: 1, column: 84) The JSP specification requires that an attribute name is preceded by whitespace

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /foreground/common/link.jsp (line: 1, column: 84) The JSP specification requires that an attribute name is preceded by whitespace
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:408)

org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:89)
org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:164)
org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:183)
org.apache.jasper.compiler.ParserController.getPageEncodingForJspSyntax(ParserController.java:479)
org.apache.jasper.compiler.ParserController.determineSyntaxAndEncoding(ParserController.java:420)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:190)
org.apache.jasper.compiler.ParserController.parseDirectives(ParserController.java:119)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:193)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:954)
org.apache.jsp.index_jsp._jspService(index_jsp.java:89)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)```

源碼:

<%@ page language="java" contentType="text/html; charset=UTF-8"pageEncoding="UTF-8"%>
<div class="row-fluid">
<div class="span12">
<div class="link">
<div class="linkHeader">友情鏈接</div>
<div class="datas">
<ul>
<li><a href="http://www.baidu.com" target="_blank">百度</a></li>
<li><a href="http://www.oschina.net" target="_blank">開源中國</a></li>
<li><a href="http://www.java1234.com" target="_blank">Java1234</a></li>
<li><a href="2" target="_blank">超鏈7</a></li>
<li><a href="http://www.csdn.com" target="_blank">CSDN</a></li>
<li><a href="" target="_blank">超鏈2</a></li>
<li><a href="" target="_blank">超鏈3</a></li>
<li><a href="" target="_blank">超鏈4</a></li>
<li><a href="" target="_blank">超鏈5</a></li>
</ul>
</div>
</div>
</div>
</div>


最後發現pageEncoding連在一起導致,按下空格一下,問題解決了

報錯:The JSP specification requires that attribute