Java 将参数输入类型隐藏值发送到另一个jsf页面

Java 将参数输入类型隐藏值发送到另一个jsf页面,java,jsf,Java,Jsf,我有上面的代码。这段代码在customerList.xhtml中,用户单击commandLink按钮后,我想将输入隐藏值发送到customerListDetailed.xhtml。我如何才能做到这一点?要做到这一点,您可以在commandLink标记之后编写隐藏标记。请注意,您应该将上述代码添加到h:form标记中 例如: <h:commandLink action="http://192.168.2.66:8084/TekirMobile2/customerListDetaile

我有上面的代码。这段代码在customerList.xhtml中,用户单击commandLink按钮后,我想将输入隐藏值发送到customerListDetailed.xhtml。我如何才能做到这一点?

要做到这一点,您可以在commandLink标记之后编写隐藏标记。请注意,您应该将上述代码添加到h:form标记中

例如:

   <h:commandLink  action="http://192.168.2.66:8084/TekirMobile2/customerListDetailed.xhtml" value="#{item.code}" >
                                <h:inputHidden value="#{item.address}" />
                                 <h:inputHidden value="#{item.name}" />

                            </h:commandLink>

您现在的问题是什么?我更新了我的问题您在学习JSF时读了哪些书/教程/资源?您的
操作
属性完全错误。它必须指向支持bean操作方法或导航案例结果。首先,您是否成功创建了一个包含2个页面的Hello World JSF应用程序?例如猜测数字等等?无论如何,在回答您的具体问题之前,我们需要知道这两个页面是否在同一个web应用程序中运行。如何在其他页面中获取这些值?@user229982:它甚至不会将我的页面重定向到其他页面为什么?在另一个页面中,我可以用for ex:#{item.getName()获取它请自己浏览JSF Hello World。在发布将来的答案之前,请先在操场环境中测试/实验自己,以便根据自己的经验确认它确实有效。您说以下代码是错误的:String name=FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap()获取(“名称”);
      <h:form>
             <h:commandLink 
    action="http://192.168.2.66:8084/TekirMobile2/customerListDetailed.xhtml" 
            value="#{item.code}" >     
            </h:commandLink>
            <h:inputHidden value="#{item.name}" name="name" id="name" />
  <h:inputHidden value="#{item.address}" name="address" id="address" />
        </h:form>
@ManagedBean(name="item")
public class Item implements Serializable{
    private String code;
    private String address;
    private String name;
    public Item(){
        String name= FacesContext.getCurrentInstance().
    getExternalContext().getRequestParameterMap().get("name");
        String address= FacesContext.getCurrentInstance().
    getExternalContext().getRequestParameterMap().get("address");
    }
   //getters and setters


}