gpt4 book ai didi

java - 丰富 :menuitem passing parameter

转载 作者:行者123 更新时间:2023-12-02 00:53:36 26 4
gpt4 key购买 nike

我使用 rich:menuitem 在 Richfaces 上构建了菜单。我需要确定用户单击了哪个菜单项。我尝试使用:

<rich:menuItem submitMode="server" value="#{msg.sidemenu_alldocs_internal_documents_bill_sent_documents}" action="#{billdoc.list}">
<f:param name="sidemenutype" value="#{bill_sent}"/>
</rich:menuItem>

但是,我在请求参数中没有看到参数 sidemenutype。为什么?

    FacesContext context = FacesContext.getCurrentInstance();
HttpServletRequest req = (HttpServletRequest) context.getExternalContext().getRequest();
String docType = (String)context.getExternalContext().getRequestMap().get("sidemenutype");

docType 为空。我可以使用 rich:menuitem 以某种方式将参数从 jsp 传递到请求吗?

最佳答案

改用f:setPropertyActionListener

<f:setPropertyActionListener target="#{billdoc.bill_sent}" value="#{bill_sent}"/>

这需要 bill_sent 属性在 billdoc bean 中具有 getter 和 setter。

关于java - 丰富 :menuitem passing parameter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1907480/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com