解决illegal to have multiple occurrences of contentType with different values错误
今天写jsp程序,在一个文件中包含了另一个文件(checkPurview.jsp)来做权限验证,可执行候却出现执行错误:
org.apache.jasper.JasperException: /admin/adminUser/../incs/checkPurview.jsp(1,1) Page directive: illegal to have
multiple occurrences of contentType with different values
(old: text/html; charset=utf-8, new: text/html;charset=utf-8)
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:236)
org.apache.jasper.compiler.Validator$DirectiveVisitor.visit(Validator.java:133)
org.apache.jasper.compiler.Node$PageDirective.accept(Node.java:590)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2399)
org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
org.apache.jasper.compiler.Validator$DirectiveVisitor.visit(Validator.java:100)
org.apache.jasper.compiler.Node$IncludeDirective.accept(Node.java:638)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2399)
org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
org.apache.jasper.compiler.Validator.validate(Validator.java:1700)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:165)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:294)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:281)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803) |
checkPurview.jsp 代码是没有错的,因为在其它页面调用没有出错过。那么是主文件出错了,看了一下刚写的页面 全是静态内容,没什
么的?
仔细阅读错误信息:
Page directive: illegal to have multiple occurrences of contentType with different values (old: text/html; charset=utf-8,
new: text/html;charset=utf-8)
中文大致意思:多个不同的ContentType值是非法的。
我英文不好,意思是理解了:包含页面与被包含页面的@page指令里面的contentType不一致,仔细检查两个文件第一行的 @page,
包含页面的是:
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> |
被包含页面:
<%@ page language="java" contentType="text/html;charset=utf-8" pageEncoding="utf-8"%> |
果然contentType="text/html;和charset=utf-8"之间多了一个空格,删除空格,使得两个文件的@page内容一致,再执行程序,运行通过。
我曾经尝试着在一个里面加上一个空格再次出现了同样的错误。
总结:被包含页面和包含页面必须都加上@page
头内容这个asp正好相反的,而且值要一致。一个很小的错误,让我调了2分钟,网上信手搜索了一下居然很多人也犯这样的错误,而且居然无从下手,想来大家
只要英文稍微好些 就看懂错误提示了,看来还是我们的基本功不扎实了,不扎实--沙上盖楼,终不会高......
转载自:http://hi.baidu.com/yinfuqing666/blog/item/668df33918d78c2d97ddd879.html
分享到:
相关推荐
今日遇到如下错误:java.security.InvalidKeyException: Illegal key size 因为美国法律限制,JAVA默认支持AES 128 Bit 的key, 如果你计划使用 192 Bit 或者 256 Bit key, java complier 会抛出 Illegal key size ...
解决illegal Key Size jdk7版本
java.security.InvalidKeyException: Illegal key size 解决方案
A:Violations Associated with Buses 有关总线电气错误的各类型(共12项) ◆bus indices out of range 总线分支索引超出范围 ◆Bus range syntax errors 总线范围的语法错误 ◆Illegal bus range values 非法的...
These techniques change the mapping of the domain name to different bots within the botnet with constant shifting, while the bots simply relay content back to a central server. This can give the ...
Chapter 23 that implement part of the RSA cipher would be illegal to export out of the United States. Because messages encrypted with RSA are impossible to hack, the export of encryption software like...
ArrayIndexOutOfBoundException is thrown when we have to indicate that an array has been accessed with an illegal index. printStackTrace in jsp printStackTrace is a method of the Throwable class. By ...
解决办法。 如在加密过程中出现下面异常: java.security.InvalidKeyException:illegal Key Size 请将两个jar文件按下列操作完成: 如果安装了JRE,将两个jar文件放到%JRE_HOME%\lib\security目录下覆盖原来的文件;...
mysql数据库和中文支持很不友好,经常见到“Illegal mix of collations for operation”错误,该如何解决呢?下面小编给大家带来了mysql数据库中涉及到哪些字符集及彻底解决中文乱码的解决方案,非常不错,一起看看...
- Updates may be licensed to you by Piriform with additional or different terms but Piriform has no obligation to provide any updates. - This License is the entire agreement between you and us and ...
<END><br>85,Shape.zip I have used SHAPE command instead of PARAMETERS to generate dynamic report.Open with VB6. <END><br>86,AlarmPrj.zip An Alarm Class project. <END><br>87,hyperlink.zip A ...
Licensee shall be solely responsible for, and Broadcom shall have no obligation to honor, any warranties that Licensee provides to its customers or to end users with respect to the Software or ...
复制并覆盖%JAVA_HOME%/jre/lib/security下的local_policy.jar 和 US_export_policy.jar
If you have received the SOFTWARE PRODUCT for purposes of evaluation (“Demonstration”) or you have purchased a Laboratory or Developer License then this SOFTWARE PRODUCT is licensed to you per the ...
本文实例讲述了JS提示:Uncaught SyntaxError: Unexpected token ILLEGAL错误的解决方法。分享给大家供大家参考,具体如下: Uncaught SyntaxError: Unexpected token ILLEGAL 未捕获的语法错误: 意想不到的非法...
AES加密时抛出java.security.InvalidKeyException: Illegal key size or default parameter
SecureCode is a new software protection designed to provide a high level of security from illegal copying, and confidence that people can only run your software on your terms. The security is internal...
* Using the Delphi 7 version of midas.dll to open an XML file that was saved with the Delphi 6 version of midas.dll results in an illegal operation. * Incorrect filter expression parsing occurs when ...
F12看到后台报了个错误:Uncaught TypeError: Illegal invocation,百度了一下,找到了解决方法。 解决方法:在ajax请求的参数中添加如下两个参数: $.ajax({ ..., processData: false, contentType: false, .....