jsf 2.2中的URL更新[重复]

问题描述 投票:0回答:1

我正在尝试在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的情况会是一样的。)?

navigation jsf-2.2
1个回答
2
投票

你没有看到这种行为,因为你使用h:link根据the specs(强调我的)

执行算法以获取用户代理在单击时应发出GET请求的URL。

因此,您可以通过不首先创建问题来有效地“修复”问题。

另见答案中的第1章

© www.soinside.com 2019 - 2024. All rights reserved.