Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top