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

jxls problem

 
Yasmeen MohdRafi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a novice in this field.

My purpose is to create a bean from xls, but i am unable to do so.
Could anyone please help me out in figuring as what the error is.
Code is as follows:

I have a bean class:


I have a xml mapping file.

I have another java file as follows


Kindly help..

[ UD: Please UseCodeTags when posting code of any length. The code is unnecessarily hard to read without them. ]
[ December 16, 2008: Message edited by: Ulf Dittmer ]
 
Cristina Tarcuta
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I do not know if you solved your problem ... but for making available a solution for other users also, I decided to post an answer.

For solving you problem your should make the following changes:
1. In the class Infoxl2Bean you need to put List infos = new ArrayList(); as class member (to declare it outside the methods) and to have a set method for it.

2. Change beans.put("infos", infos); to beans.put("infosHolder", this);

3. In the config XML change items="infos" to items="infosHolder.infos"

Good luck.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cristina and welcome to the Javaranch!

I'd normally say Don't wake the zombies, they bite! but we're easing up on that polciy a little, just posting the link for your future reference .

Happy ranching!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic