2011-02-10 50 views
1

我有引入了menu.jsp的内容如下JSF菜单没有得到显示

<%@ 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> 

    <jsp:include page="menucontents.jsp" /> 
</f:view> 
</body> 
</html> 

为menucontents.jsp的内容如下

<f:subview id="menucontents"> 
    <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>&#8250; </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>&#8250; </f:verbatim> 
        <t:outputText value="#{menu['menu_admin_change_password']}"/> 
       </t:commandNavigation2> 
       <t:commandNavigation2> 
        <f:verbatim>&#8250; </f:verbatim> 
        <t:outputText value="#{menu['menu_admin_forgot_password']}"/> 
       </t:commandNavigation2> 
      </t:commandNavigation2> 

     </t:panelNavigation2> 
    </t:div> 
</f:subview> 

当我打电话引入了menu.jsp为某些原因,我无法查看我配置的菜单,我只能在浏览器中看到“>>>”。

当我做我看到下面的HTML视图源

<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="/cpcnew/pages/css/basic.css" /> 
</head> 
<body> 



<f:subview id="menucontents"> 
    <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>&#8250; </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>&#8250; </f:verbatim> 
        <t:outputText value="#{menu['menu_admin_change_password']}"/> 
       </t:commandNavigation2> 
       <t:commandNavigation2> 
        <f:verbatim>&#8250; </f:verbatim> 
        <t:outputText value="#{menu['menu_admin_forgot_password']}"/> 
       </t:commandNavigation2> 
      </t:commandNavigation2> 

     </t:panelNavigation2> 
    </t:div> 
</f:subview> 



<script type="text/javascript"><!-- 

    function getScrolling() 
    { 
     var x = 0; var y = 0;if (self.pageXOffset || self.pageYOffset) 
     { 
      x = self.pageXOffset; 
      y = self.pageYOffset; 
     } 
     else if ((document.documentElement && document.documentElement.scrollLeft)||(document.documentElement && document.documentElement.scrollTop)) 
     { 
      x = document.documentElement.scrollLeft; 
      y = document.documentElement.scrollTop; 
     } 
     else if (document.body) 
     { 
      x = document.body.scrollLeft; 
      y = document.body.scrollTop; 
     } 
     return x + "," + y; 
    } 

//--></script> 
</body> 
</html> 

我很近又那么远会很感激,如果有人可以帮助我搞清楚这个问题

回答

1

难道这包含页面完整?文件头中缺少标签库。

<%@ 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输出中出现普通香草的原因。

+0

添加了taglib,但仍未获取格式化菜单 – 2011-02-10 22:25:11