CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Java

 export to file (CCS3/Jsp)

Print topic Send  topic

Author Message
tw_vincent

Posts: 3
Posted: 12/20/2007, 3:27 AM

Hi,

I created a button, when users press the button, the page will export some data to a file format and download, I write some codes for server onclick event, it works, but it still has redirect exception on server log.

code example:
-------------------------------------------------
page.getResponse().setContentType("application/octet-stream;");
page.getResponse().addHeader("Content-Disposition","attachment; filename=" + exportFileName + ";");
......
Writer w = page.getResponse().getWriter();
w.write( key_sb.toString() );
w.flush();
---------------------------------------------------
server error message:
2007/12/20 下午 01:36:55 org.apache.catalina.core.StandardWrapperValve invoke
Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException
at org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:435)
at com.codecharge.components.Page.redirect(Page.java:523)
......

Thanks


Vincent
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.