• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Duplicate component Error in JSF 1.2 with Jboss AS 7

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

Thanks for the explanation.
 
reply
    Bookmark Topic Watch Topic
  • New Topic