gpt4 book ai didi

java - jsf 应用程序中的 org.apache.jasper.JasperException

转载 作者:行者123 更新时间:2023-11-28 23:46:19 24 4
gpt4 key购买 nike

我在打开 jspx 页面时遇到以下错误。

org.apache.jasper.JasperException: /login.jspx(9,54) Document root element "ui:composition", must match DOCTYPE root "composition".
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
at org.apache.jasper.compiler.JspDocumentParser.parse(JspDocumentParser.java:214)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:239)
at org.apache.jasper.compiler.ParserController.parseDirectives(ParserController.java:120)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:180)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:347)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

JSF 文件内容:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition
template="/jsp/common/classic-template-login.jspx"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xmlns:ui="http://java.sun.com/jsf/facelets" >

<div align="left"><ui:define name="title">OES Admin</ui:define></div>

<ui:define name="toolbar">
</ui:define>

<ui:define name="pageView">

<ui:decorate template="/jsp/common/page-include-template.jspx">

<ui:define name="pageName" ></ui:define>

<ui:define name="pageActions">
</ui:define>

<ui:define name="pageContent">
<ui:include src="/WEB-INF/includes/login.jspx"/>
</ui:define>
</ui:decorate>
</ui:define>
</ui:composition>

最佳答案

注意您的术语:这是 facelets 页面,而不是 JSP 页面。仅仅因为您将 url 映射到“*.jspx”并不能做到这一点。您可能认为这是一件小事,但 facelets 是 JSP 技术的完全替代品,并且在幕后的工作方式完全不同。

我唯一能发现的是我自己的 facelets 页面之间的区别是我的 facelets 页面有一个额外的命名空间声明。

<ui:composition xmlns="http://www.w3.org/1999/xhtml"

关于java - jsf 应用程序中的 org.apache.jasper.JasperException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13893747/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com