aspose file tools*
The moose likes Struts and the fly likes Export data to csv file using Struts Action & Servlet Or Struts DownloadAction - HELP PLZZZ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Export data to csv file using Struts Action & Servlet Or Struts DownloadAction - HELP PLZZZ" Watch "Export data to csv file using Struts Action & Servlet Or Struts DownloadAction - HELP PLZZZ" New topic
Author

Export data to csv file using Struts Action & Servlet Or Struts DownloadAction - HELP PLZZZ

John P Joseph
Greenhorn

Joined: May 14, 2005
Posts: 11
Hello Everyone,

I tried two approaches to export CSV data and each one gives a different issue.

Approach 1 - Using a Struts Action class and Servlet

Here the problem is when i export the file, it gives me an option to save/open the file and after that the mouse cursor will show the waiting icon and i cant do anything on the browser window. the browser completely freeze there and i cant do anything on it unless i refresh the page. Anybody know whats going on here? See the code below:

Struts action class



Export Servlet


Toggle HighlightingOpen in New WindowSelect All


Struts.xml file entry.

<action path="/filedownload" type="com.myapp.ExportUserDetail" name="myForm" scope="session" validate="false">
</action>


Approach 2 - Using a Struts DownloadAction class

This approach is giving me new issue. I got the below error when i tried to execute the ReportDownload Action class. code attached

Error:

<Jun 7, 2011 4:55:23 PM CDT> <Warning> <org.apache.struts.action.RequestProcessor> <BEA-000000> <Unhandled Exception thrown: class java.lang.IllegalStateException>

My Class which extends DownloadAction


Finally when i ran the application, console printed the SOP line inside the getInputStream function and then i got the "RequestProcessor" error message which is given above.

I am running out of options here. Please help
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Export data to csv file using Struts Action & Servlet Or Struts DownloadAction - HELP PLZZZ