我正在尝试在jsf 2.2中学习导航(Page Forward vs Page Redirect)。我在jsf中遇到了this URL更新问题。我已经编写了一些测试,在我的情况下URL总是更新。
第1页:
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html"
template="components/defaultLayout.xhtml">
<ui:param name="bodyClass" value="container body-nomargin" />
<ui:define name="body">
<h1>Welcome </h1>
<h:panelGroup layout="block" styleClass="col-md-12">
<h:form>
<h:link outcome="detail" value="some value"> </h:link>
</h:form>
</h:panelGroup>
</ui:define>
</ui:composition>
详细信息页面
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html"
template="components/defaultLayout.xhtml">
<ui:param name="bodyClass" value="container body-nomargin" />
<ui:define name="body">
<h:outputLabel value="Hello, world"/>
</ui:define>
</ui:composition>
1)这个URl的问题是否在jsf 2.2中甚至不再存在,或者我在这里指的是过时的来源(来源提到它是针对jsf 2.0的,但我猜测jsf 2.2的内容会相同。) ?
答案 0 :(得分:2)
根据the specs(强调我的)使用h:link
,您不会看到此行为
执行算法以获取用户代理在点击时应发出 GET 请求的网址。
所以你有效地修复了#39;通过不首先创建它的问题。
另见答案中的第1章