一个关于jsf中标签的问题?

whatday 2007-08-31 04:40:48
问题1:当一个链接未指定跳转地址时,他就随机变成前面的链接地址,这是为什么呢?具体请看header.jsp的"Go!"链接。
问题2:当才启动服务器后链接要点击2次才有效,链接后也要后退2次才可以回到原来页面,这是为什么呢?具体请看header.jsp中的链接。
header.jsp:
<f:view>
<h:form>
<h:panelGrid columns="3">
<h:panelGrid id="header" columns="9">
<h:outputText value="ProjectTrack:"/>
<h:commandLink action="inbox">
<h:graphicImage url="images/inbox.gif" alt="inbox"/>
<h:outputText value="inbox"/>
</h:commandLink>
<h:commandLink action="show_all">
<h:graphicImage url="images/show_all.gif" alt="Show all projects"/>
<h:outputText value="Show all"/>
</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:"/>
</h:outputLabel>
<h:selectOneListbox
id="languageSelect"
size="1">
<f:selectItem itemLabel="English"
itemValue="English"/>
<f:selectItem itemLabel="Russian"
itemValue="Russian"/>
</h:selectOneListbox>
<h:commandButton value="Go!"/>
</h:panelGroup>
<h:outputText value="proj_mgr"/>
</h:panelGrid>
</h:form>
</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>
</faces-config>
...全文
399 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
whatday 2007-09-02
  • 打赏
  • 举报
回复
恩 按照你说的方法试了下 都解决了 但是这是为什么呢 具体说说其含义萨?
wu_07 2007-09-01
  • 打赏
  • 举报
回复
<h:commandButton value="Go!" onclick="return false;"/>

第二个问题加上,immediate="true"试一下

81,092

社区成员

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

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