This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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
 
Similar Threads
How to Return a File using Servlet
Writing a new line character
error outputting a pdf file
Generating PDF and displaying it ...
displaying pdf file