• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Downloading a file from the server.

 
janet ilieva
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having trouble with downloading a file from the server.
the programme works like this:
1. send request from a form to a controller
2. controller runs a RequestHandler - Java code that gets session beans
and creates the file,
3. I then set the content type and output the file
now the problem is that when I return to the controller, it tries to
forward to a new page. this it cannot do because I have sent output.
I have tried to use the form to open a window with javascript and download
the file like that but its too quick, the file has not jet been generated.
If anyone has any comments to help me or a solotion please respond.
Thanks
 
Suneel Setlur
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Janet,
Are you using a session bean to create a file and write content?
EJBs cannot use io operations to read or write and hence cannot create a file.
Suneel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic