This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am trying to map the JAXB Java object- 'Coverage' to a Java form bean-'CoverageForm'. I have a List -'coverageList' of Coverage objects.In the Coverage object, I have a list of content objects 'cov.getContent()' of type JAXBElement, Limit,Deductible. I need to set the cov.getContent() list values to a form bean-'CoverageForm'
cov.getContent() list is dynamic.So for each Coverage object, cov.getContent() can be of size 5 or 3 or anything. How can I set the dynamic list of different objects-'cov.getContent()' to a form bean object-'CoverageForm' ? The below code of Action class do not show the expected result. I have tried to hardcode the index value but it throws ArrayIndexoutOfBoundExeception because in each Coverage object the cov.getContent() can be of size 5 or 3 or anything. If you see I need to set the limit.getFormatInteger() to LowLimit and HighLimit of CoverageForm while looping.How can I achieve this?Please suggest me.
To get an idea of the XML elements structure-'coverageList' structure is-