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" %>


你可能感兴趣的:(java,jsp,weblogic,servlet,Security)