-2
同じトピックについて多くの質問がありましたが、いずれも助けられませんでした。実際、私は素体の学習を始めています。私はGlassfishのサーバーを起動して、私はそのエラーを取得し、ビルドを展開するとき@PostConstructがjsfページで呼び出されていません
@Named
@SessionScoped
public class KpiBean implements Serializable {
private String page= "View";
@PostConstruct
public void init() {
page = "View"; // Default include.
}
public String getPage() {
return page;
}
public void setPage(String page) {
this.page = page;
}
}
:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<f:view contentType="text/html" locale="en">
<h:head>
<title><ui:insert name="title">Master Data</ui:insert></title>
<h:outputStylesheet library="css" name="layout.css"/>
<h:outputStylesheet library="css" name="jsfcrud.css"/>
<h:outputScript library="js" name="jsfcrud.js"/>
</h:head>
<h:body>
<p:growl id="growl" life="3000" />
<h:panelGroup layout="block" styleClass="slogan">
<h:outputText value="Master Data Web module for single line v 1.0"/>
</h:panelGroup>
<h:form id="mainForm" prependId="false">
<h:panelGrid columns="2" columnClasses="chaptersMenuColumn,chaptersContentColumn">
<h:form>
<f:ajax render=":content">
<p:menu>
<p:submenu label="Master Data Sections">
<p:menuitem value="KPI" action="#{KpiBean.setPage('create')}" />
<p:menuitem value="Queues" url=""/>
<p:menuitem value="Causes" url=""/>
<p:menuitem value="SubCauses" url=""/>
</p:submenu>
</p:menu>
</f:ajax>
</h:form>
<h:panelGroup id="content" layout="block">
<ui:include src = "../views/#{KpiBean.page}.xhtml"/>
</h:panelGroup>
</h:panelGrid>
</h:form>
</h:body>
</f:view>
</html>
そして、ここに私の豆:ここ
は私のXHTMLページ(テンプレート)です
javax.faces.view.facelets.TagAttributeException: /templates/template.xhtml @47,78 <ui:include src="../views/#{KpiBean.page}.xhtml"> Invalid path : ../views/.xhtml
at com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:129)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
あなたは正しいですが、私はまだ同じ問題を抱えています。豆は全く作られていないようです –