The taglib validator rejected the page 问题的解决

问题:
在weblogic8.1,windows OS环境那个下开发web Application,某个JSP文件中要用到JSTL,所以:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html; charset=GBK"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>


但是运行该JSP页面时候,出现下面问题:

<Error> <HTTP> <BEA-101019> <[ServletContext(id=3905211,name=/dygl,context-path=/dygl)] Servlet failed with IOException
java.io.IOException: javax.servlet.jsp.JspException: The taglib validator rejected the page: "java.io.UTFDataFormatException: Invalid byte 2 of 2-byte UTF-8 sequence., "
at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:125)
at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:258)
at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:364)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:220)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:172)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:504)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:349)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6316)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>



原因:
是由于 <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>,引起的,因为当把该句话去掉,一切正常。

解决方法:

<%@ page contentType="text/html; charset=GBK"%>


改为:


<%@ page contentType="text/html; charset=GBK" pageEncoding="GBK" %>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值