开发者

duplicate <param>s in seam's pages.xml

Using seam, in pages.xml I can catch the value of a query string parameter and put it in a backing bean like so:

  <page view-id="/my/page.xhtml" >
    <param name="myParam" value="#{myActionBackingBean.param}" />
    <action execute="#{myActionBackingBean.doAction()}" />
  </page>

As far as I've read, this will also take the value out of the backing bean and put it back in the query string over a redirect (i.e. defines a two-way binding).

In the project I'm working on, we have a few pages with duplicate params, like this:

  <page view-id="/my/page.xhtml" >
    <param name="myParam" value="#{myActionBackingBean.param}" />
    <param name="myParam" value="#{myDifferentBackingBean.param}" />
    <action execute="#{myActionBackingBean.doAction()}" />
  </page>

This seems to compile and run fine, but eclipse has started reporting an error (since a recent update, possibly a plugin update) that "Value myParam is not unique" for the second param name.

  • Are duplicate param tags like this invalid as suggested by eclipse?
  • What is the most likely behaviour to expect in the second case?
  • Is there another way to get the value of a query string parameter into two beans (could it be done using an <action> to copy from one to the other with EL, for example)

I have开发者_运维百科 a lot of seam and EL to learn so I'm grateful for any good sources if these questions seem naive.


Probably the best way to do so is to create another bean just to keep your information and simply bind it to it.

Then you can inject it into myActionBackingBean and myDifferentBackingBean.

Otherwise you can copy it from one to another during the @Create method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜