一个关于jsf中镶嵌jsp页面的问题?

whatday 2007-08-31 04:47:38
我把header.jsp文件镶嵌如inbox.jsp中,inbox.jsp中的<h:commandLink>全部失效为什么呢?具体请看header.jsp inbox.jsp faces-config.xml.
header.jsp:
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<f:subview id="header">
<h:form>
<h:panelGrid columns="3"
cellspacing="0"
cellpadding="0"
styleClass="header"
width="100%">
<h:panelGrid id="header" columns="9"
cellpadding="4"
cellspacing="0"
border="0">
<h:outputText value="ProjectTrack:" styleClass="header-header"/>
<h:commandLink action="inbox">
<h:graphicImage
url="images/inbox.gif"
styleClass="header-icon"
alt="inbox"/>
<h:outputText value="inbox"
styleClass="header-command"/>
</h:commandLink>
<h:commandLink action="show_all">
<h:graphicImage url="images/show_all.gif"
styleClass="header-icon"
alt="Show all projects"/>
<h:outputText value="Show all" styleClass="header-command"/>
</h:commandLink>

<h:commandLink action="create">
<h:graphicImage url="images/create.gif"
styleClass="header-icon"
alt="Create a new project"/>
<h:outputText value="Create new" styleClass="header-command"/>
</h:commandLink>

<h:commandLink action="logout">
<h:graphicImage url="images/logout.gif"
styleClass="header-icon"
alt="Logout"/>
<h:outputText value="Logout" styleClass="header-command"/>
</h:commandLink>
</h:panelGrid>

<h:panelGroup>
<h:outputLabel for="languageSelect">
<h:outputText value="Langage:"
styleClass="language-select"/>
</h:outputLabel>
<h:selectOneListbox
id="languageSelect"
size="1"
styleClass="language-select">
<f:selectItem itemLabel="English"
itemValue="English"/>
<f:selectItem itemLabel="Russian"
itemValue="Russian"/>
</h:selectOneListbox>
<h:commandButton value="Go!" styleClass="language-select-button"/>
</h:panelGroup>
<h:outputText value="proj_mgr" styleClass="user-name"/>
</h:panelGrid>
</h:form>
</f:subview>

inbox.jsp:
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>

<f:view>
<html>
<head>
<title><h:outputText value="ProjectTrack - Inbox"/></title>
</head>
<body class="page-backgroud">
<jsp:include page="header.jsp"/>
<h:form>
<h:panelGrid headerClass="page-header"
styleClass="table-backgroud"
columns="1" cellpadding="5" >

<f:facet name="header">
<h:outputText
value="Inbox -a pprove or reject projects"/>
</f:facet>

<h:outputText
value="Appli/.cation messages." styleClass="errors"/>
<h:panelGrid columns="6"
styleClass="table-background"
rowClasses="table-odd-row,table-even-row"
cellpadding="3">
<h:commandLink styleClass="table-header">
<h:outputText value="Project name"/>
</h:commandLink>
<h:commandLink styleClass="table-header">
<h:outputText value="Type"/>
</h:commandLink>
<h:commandLink styleClass="table-header">
<h:outputText value="Status"/>
</h:commandLink>
<h:panelGroup/>
<h:panelGroup/>
<h:panelGroup/>

<h:outputText
value="Inventory Mananger v2.0"/>
<h:outputText
value="Internal Desktop Application"/>
<h:outputText
value="Requirements/Analysis"/>
<h:commandLink action="approve">
<h:outputText value="Approve"/>
</h:commandLink>
<h:commandLink action="reject">
<h:outputText value="Reject"/>
</h:commandLink>
<h:commandLink action="details">
<h:outputText value="Details"/>
</h:commandLink>

<h:outputText value="TimeTracker"/>
<h:outputText value="Internal Web Application"/>
<h:outputText value="Requriements/Analysis"/>
<h:commandLink action="approve">
<h:outputText value="Approve"/>
</h:commandLink>
<h:commandLink action="reject">
<h:outputText value="Reject"/>
</h:commandLink>
<h:commandLink action="details">
<h:outputText value="Details"/>
</h:commandLink>
</h:panelGrid>
</h:panelGrid>
</h:form>
</body>
</html>
</f:view>

faces-config.xml:
<faces-config>
<navigation-rule>
<from-view-id>/*</from-view-id>
<navigation-case>
<from-outcome>inbox</from-outcome>
<to-view-id>/inbox.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>show_all</from-outcome>
<to-view-id>/show_all.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>create</from-outcome>
<to-view-id>/create.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>logout</from-outcome>
<to-view-id>/logout.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/*</from-view-id>
<navigation-case>
<from-outcome>approve</from-outcome>
<to-view-id>/approve.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>details</from-outcome>
<to-view-id>/details.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>reject</from-outcome>
<to-view-id>/reject.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>

...全文
260 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
susanchen1982 2008-08-01
  • 打赏
  • 举报
回复
faces-config.xml:
<from-view-id> /* </from-view-id>
配錯了吧?
你應該是在用<<JSF in action>>裡面的例子吧?從網上down源碼下來, 比較一下就出來了.

81,090

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧