Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Duplicate component Error in JSF 1.2 with Jboss AS 7

 
Ifta Khirul
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

We are currently migrating our application from Jboss 5 to Jboss 7.
Our application used JSF 1.2 . We are not going to change the JSF version now.

There was a piece of code that worked with jboss 5 but not with jboss 7. Check below for that code -

<x:selectManyListbox tabindex="5" title="Counter names and indexes" value="#{counterJob.jsfSelectedIndexedCounterNames}" id="indexed_counter_names" forceId="true" size="8">
<f:selectItems value="#{counterJob.jsfIndexedCounterNames}" id="indexed_counter_names" />
</x:selectManyListbox>

Here both selectManyListbox and selectItems holds a common id named-> indexed_counter_names .
But in Jboss 5 AS this was not a problem and we got no error.

When we shifted to Jboss 7 then it created a problem and showed a Duplicate Component Id error.
I have changed the id for selectedItems and then it worked perfectly in Jboss 7.


Here is my question - we have not changed the JSF version.
So why does it shows different behavior in Jboss Application Server (Jboss 5 and Jboss 7) ?

Any explanation regarding this matter will help me to understand the scene behind the behavior.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18169
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Ifta!

Actually, this should have always been a problem!

The "id" attribute is special. It's actually part of the core XML spec, and it carries a constraint: Each id value in an XML file MUST be unique. This is true whether the XML is JSF, SOAP, or any random XML format you may device.

So your original xhtml should have failed XML validation and that means that effectively JBoss has fixed a bug.
 
Ifta Khirul
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,

Thanks for the explanation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic