报错:The JSP specification requires that attribute

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连在一起导致,按下空格一下,问题解决了

原文地址:http://blog.51cto.com/213qingnian/2300175

时间: 2024-10-09 15:55:41

报错:The JSP specification requires that attribute的相关文章

eclipse中The JSP specification requires that an attribute name is preceded by whitespace

在eclipse中出现这错误,但在myeclipse中灭有 /WEB-INF/page/mailWrite.jsp (line: 1, column: 82) The JSP specification requires that an attribute name is preceded by whitespace 问题出在一个空格 1对 <%@page language="java" contentType="text/html;charSet=UTF-8"

The JSP specification requires that an attribute name is preceded by whitespace

一个jsp页面在本地运行一点问题没有,发布到服务器就报错了: The JSP specification requires that an attribute name is preceded by whitespace, 最后发现竟然是这么一上小问题,在pageEncoding="GBK"前面少了一个空格 <%@ page language="Java" contentType="text/html; charset=GBK"pageEn

The JSP specification requires that an attribute name is

把另一个博客内容迁移到这里 七月 10, 2016 10:23:12 上午 org.apache.catalina.core.ApplicationDispatcher invoke 严重: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: /index.jsp (line: 5, column: 55) The JSP specification requires that

textcolor 设置selecter 报错: &lt;item&gt; tag requires a &#39;color&#39; attribute or child tag defining a drawab

如果是textview的textcolor属性设置成selecter,则需要这么写这个selecter: <span style="font-size:14px;"><?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <i

The JSP specification requires that an attribute name is preceded by whitespace--异常

异常信息:org.apache.jasper.JasperException: /pages/selectedCourse.jsp (line: 4, column: 39) The JSP specification requires that an attribute name is preceded by whitespace --这个我简直要报警了,就少了个空格!

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

出现的错误: 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

python中引入包的时候报错AttributeError: module &#39;sys&#39; has no attribute &#39;setdefaultencoding&#39;解决方法?

python中引入包的时候报错:import unittestimport smtplibimport timeimport osimport sysimp.reload(sys)sys.setdefaultencoding('utf-8') AttributeError: module 'sys' has no attribute 'setdefaultencoding'解决方法: 1.python2中解决方法:reload(sys)sys.setdefaultencoding('utf-8'

Tomcat启动后访问首页报错 显示JSP 空指针异常

HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: java.lang.NullPointerException org.apache.jasper.serv

python-pip升级报错- AttributeError: &#39;NoneType&#39; object has no attribute &#39;bytes&#39;

正常的pip升级命令: python -m pip install --upgrade pip 在pytharm里面创建了一个Python项目,pytharm会自动搭建一个新的Python环境,在当前的目录下使用 python -m pip install --upgrade pip 会报错 AttributeError: 'NoneType' object has no attribute 'bytes' 可以使用如下方式 easy_install -U pip python-pip升级报错-