This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes jxls problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "jxls problem" Watch "jxls problem" New topic
Author

jxls problem

Yasmeen MohdRafi
Greenhorn

Joined: Nov 27, 2008
Posts: 2
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

Joined: Jun 18, 2009
Posts: 1
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

Joined: Jun 24, 2003
Posts: 3274
    
    5

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!


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
Consider Paul's rocket mass heater.
 
subject: jxls problem
 
Similar Threads
jxls problem reading file.
How to create object and call a method in jsp using struts 2 tags
Read excel file using jXls
Help in jxls reader
[newbie] IllegalAccessException