Can I “pass” an object with a JSF param tag?

后端 未结 1 1006
孤街浪徒
孤街浪徒 2020-12-14 19:58

What I\'m looking for is to have an f:param tag with an Object of my own choosing in the value attribute. Then, in the backing bean method for the action, I would like to be

1条回答
  •  余生分开走
    2020-12-14 20:51

    You can't do that with . It needs to be appended to the URL of the request, so it really needs to be a String. Just use instead.

    E.g.

    
        
    
    

    This way the #{otherBean} is just available as this.otherBean inside submit() method. This way you also don't need to mess with the request parameter map (for which in case of I would rather have used managed property injection with #{param.name} instead).

    Alternatives are using in combination with a Converter or using Tomahawk's . Also see this blog article for more background info and examples.

    0 讨论(0)
提交回复
热议问题