wood burning stoves 2.0*
The moose likes Struts and the fly likes ActionForward after Excel display 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 » Frameworks » Struts
Bookmark "ActionForward after Excel display" Watch "ActionForward after Excel display" New topic
Author

ActionForward after Excel display

Stephanie Johnson
Greenhorn

Joined: Jun 03, 2009
Posts: 8
I am using struts 1.3.8. I have a simple JSP page with a button, the click of which generates an Excel file. Inside my action class, I write the excel file to response's output stream. I dont want my ActionForward to redirect me anywhere. I just want to stay on the same JSP page that requested for the Excel file.

I tried redirecting my ActionForward to null, but I am getting an exception while doing that. Any thoughts?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'm not sure what "redirecting an ActionForward to null" means, but you should be able to return null from the action to prevent further Struts processing of the response.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ActionForward after Excel display
 
Similar Threads
How to Open Excel file from JSP page.
excel page not opening in a browser
Does Open option create a new Excel sheet
how can I control "excel" when I use setContentType("application/vnd.ms-excel")
how can I control "excel" when I use "application/vnd.ms-excel"?