Jsf Netbeans,jsp:include
我在NetBeans中使用JSF。我只想在另一个页面中包含一个页面。但是无论我尝试了什么,当我运行主页时,我没有得到任何错误,但是我无法在主页中看到我包含的页面。为什么? 我的主页是:Jsf Netbeans,jsp:include,jsf,netbeans,include,Jsf,Netbeans,Include,我在NetBeans中使用JSF。我只想在另一个页面中包含一个页面。但是无论我尝试了什么,当我运行主页时,我没有得到任何错误,但是我无法在主页中看到我包含的页面。为什么? 我的主页是: <jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page"
<jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
<f:view>
<webuijsf:page id="page1">
<webuijsf:html id="html1">
<webuijsf:head id="head1">
<webuijsf:link id="link1" url="/css/front.css"/>
<webuijsf:script id="script1" url="/scripts/front2.js"/>
<webuijsf:link url="favicon.ico" rel="shortcut icon" type="image/x-icon"/>
</webuijsf:head>
<webuijsf:body id="body1" style="-rave-layout: grid">
<webuijsf:form id="form1">
<!-- This is where I include my page -->
<f:subview id="nav">
<jsp:include page="frontsitemenu.jsp" />
</f:subview>
</webuijsf:form>
</webuijsf:body>
</webuijsf:html>
</webuijsf:page>
</f:view>
我的附页是:
<f:subview id="frontsitemenu">
<f:verbatim>
<p>rrrrrrrrrrrrrrrrrr</p>
</f:verbatim>
</f:subview>
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
有人能帮我吗?谢谢我建议您使用:
<%@include file="_frontsitemenu.jsp" %>
这就是对我有效的方法每个include应该只有一个子视图。现在您有两个,一个是
,它将jsp:include
包装起来,另一个是
在include页面内部。通常的做法是将它们仅放在include文件中。因此,从父页面中删除
。我将检查frontsitemenu.jsp文件的位置。可能它不在您认为的目录中,您必须包含从web应用程序根目录到该文件的路径。