2012-08-03 2 views
0

JSF의 faces-config 파일에서 xhtml 페이지에 삽입 된 경로를 가져 오려고합니다. 얼굴-설정에서 : XHTML에서faces-config에서 경로 가져 오기

<navigation-rule> 
    <from-view-id>*</from-view-id> 
    <navigation-case> 
     <from-outcome>left</from-outcome> 
     <to-view-id>/Template/LeftPage.xhtml</to-view-id> 
    </navigation-case> 
</navigation-rule> 

, 내가 UI 태그 <ui:include src="??????" />에서 그것을 얻으려면, 이렇게 저를 도와주세요.

답변

0

faces-config가 및 네비게이션 페이지 관리 빈을 선언 할 때 을 사용한다고 생각합니다. 이 같은 사용

<f:view xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:ui="http://java.sun.com/jsf/facelets" 
    xmlns:h="http://java.sun.com/jsf/html" 
    xmlns:a4j="http://richfaces.org/a4j" 
    xmlns:f="http://java.sun.com/jsf/core" 
    xmlns:rich="http://richfaces.org/rich"> 
<meta http-equiv="Content-Type" content="text/html"/> 
<head> 
</head> 
    <body > 
    <h:form > 
    <div id="messagediv"> 
     <rich:messages globalOnly="true" style="color:red;font-size:12px;weight:bold;"/> 
    </div> 
     <div align="center"> 
      <table cellpadding="0" cellspacing="0" border="0" width="1160"> 
       <tbody> 
        <tr> 
         <td> 
          ***<ui:include src="/include/header1.xhtml" />*** 
         </td> 
        </tr> 
        <tr> 
         <td> 
          <div style="background:white;padding: 20px 20px 20px 30px;height:#{contentHeight}px;"> 
           <ui:insert name="content"/> 
          </div> 
         </td> 
        </tr> 
       </tbody> 
      </table> 
     </div> 
    </h:form> 
</body> 

+0

감사 BalusC! 경로 사용에 문제가 있습니다. 만약 이것이 인덱스 페이지라면,''을 사용하는 폴더에는 없지만'Emp'라는 이름의 폴더에 페이지를 남겨 둡니다. 내가 할 수 있을까? 나는 언젠가 접두사에'/ faces /'를 추가해야만 언젠가 페이지가 이해할 수 있을지 모르겠다. 나는 그것을 필요로하지 않는다. –

관련 문제