JSF에서 메뉴를 구현하려고합니다.JSF에 관련된 문제 메뉴 포함
menucontents.jsp :
는<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=UTF-8" />
<title>MyFaces - the free JSF Implementation</title>
<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/pages/css/basic.css" />
</head>
<body>
<f:view>
<f:loadBundle basename="com.cpc.resources.menu" var="menu"/>
<t:div id="hNav_outer">
<t:panelNavigation2 id="nav1" layout="list" itemClass="off" activeItemClass="on" openItemClass="on"
renderAll="true">
<t:commandNavigation2 value="#{menu['menu_Home']}" style="padding-left: 0px;">
<t:commandNavigation2>
<f:verbatim>› </f:verbatim>
<t:outputText value="#{menu['menu_Home']}"/>
</t:commandNavigation2>
</t:commandNavigation2>
<t:commandNavigation2 value="#{menu['menu_admin']}" style="padding-left: 150px;">
<t:commandNavigation2>
<f:verbatim>› </f:verbatim>
<t:outputText value="#{menu['menu_admin_change_password']}"/>
</t:commandNavigation2>
<t:commandNavigation2>
<f:verbatim>› </f:verbatim>
<t:outputText value="#{menu['menu_admin_forgot_password']}"/>
</t:commandNavigation2>
</t:commandNavigation2>
</t:panelNavigation2>
</t:div>
</f:view>
</body>
</html>
menu.jsp : 나는 HTML/BODY/f를 제거하여, 즉 다양한 조합을 시도
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=UTF-8" />
<title>MyFaces - the free JSF Implementation</title>
<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/pages/css/basic.css" />
</head>
<body>
<f:view>
<f:subview id="headerinclude1">
<jsp:include page="menucontents.jsp" />
</f:subview>
</f:view>
</body>
</html>
:보기 태그 아무것도하지만 나는를 작동하는 것 같군 내가 그것을 잘못 할 수있는 것을 어딘가에서 알 수 없다. 어떤 도움을 주시면 감사하겠습니다.
또한 코드의 첫 번째 부분은 단일 파일로 실행될 때 매우 잘 작동합니다. 다른 JSP에 메뉴를 포함 시키면 나타나는 유일한 문제입니다.
@ BalusC에게 정말 고마워요. 당신이 언급 한 것들을 시도해 보았습니다. 이제는 menu.jsp를 호출 할 때 브라우저의 출력으로 다음과 같은 ">>>"을 얻을 수 있습니다. –
You 환영합니다. – BalusC
@BalusC 원하는 출력을 얻지 못하고 있습니다. ">>>"브라우저의 출력으로 나타납니다. –