Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
A Functional Approach to Java: Augmenting Object-Oriented Java Code with Functional Principles
this week in the
Functional programming
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Liutauras Vilda
Ron McLeod
Jeanne Boyarsky
Paul Clapham
Sheriffs:
Junilu Lacar
Tim Cooke
Saloon Keepers:
Carey Brown
Stephan van Hulst
Tim Holloway
Peter Rooke
Himai Minh
Bartenders:
Piet Souris
Mikalai Zaikin
Forum:
Struts
download content is outputting to my browser not creating a download file
Mark Tobin
Ranch Hand
Posts: 37
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi I am trying to download file of xml created by my application.
I have the following action
<action name="createDoc" class="com.myapp" method="createDoc"> <result name="success" type="stream"> <param name="contentType">text/plain</param> <param name="inputName">inputStream</param> <param name="contentDisposition">filename="TestResults.xml"</param> <param name="bufferSize">1024</param> </result> </action>
Instead of getting the downlaod prompt TestResults are outputted straight onto my browser
Mark Tobin
Ranch Hand
Posts: 37
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You need to force it, it will default to the browser since it is XML
so need the following
<param name="contentDisposition">attachment;filename="TestResults.xml"</param>
Added attachment
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
downloading a file ok; also want to navigate to another page in the same action not sure how to
PDF download Using Struts
StreamResult changes file name during download on Mobile phone
Download file issue
Browser gets refreshed after file download in Struts2
More...