I'm working on struts 2 with hibernate 3. I've a functionality of Importing from excel doc in it. I found how to import from excel file once the file is uploaded by using the following code.
try {
File uploadToBatch=new File("C:\\Users\\user\\Desktop\\Book2.xls");
Workbook w;
w = Workbook.getWorkbook(uploadToBatch);
Sheet sheet = w.getSheet(0);
System.out.println(sheet.getName()+" "+sheet.getColumns()+" "+sheet.getRows());
for(int i=0;i<sheet.getRows();i++)
for(int j=0;j<sheet.getColumns();j++)
System.out.println(sheet.getCell(j, i).getContents());
} catch (Exception e) {
e.printStackTrace();
System.out.println(e.getMessage());
//addActionError(e.getMessage());
// return ERROR;
}
Now what I want is when the user drags some rows from excel file and drops into the webpage I have to get the values and pass it to server. I can't use an ActiveX object since it must support all operating systems and browsers as well.
Please give me some ideas.