• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting headers for file downloads  RSS feed

 
Rangarajan Balasubramanian
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the coding to when we send the response as pdf in servlet?






[Ben Souther]
Changed subject to something meaningful
[ March 10, 2006: Message edited by: Ben Souther ]
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read your previous post first.
[ March 10, 2006: Message edited by: Chetan Parekh ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rangarajan Balasubramanian,

Welcome to Javaranch.
To help you get the most from these forums, we've compiled a list of tips for asking questions. The complete list can be found here:
http://faq.javaranch.com/view?HowToAskQuestionsOnJavaRanch

In particular, please read:
http://faq.javaranch.com/view?UseAMeaningfulSubjectLine

In response to your question, you would want to set the Content-Type and Content-Disposition headers.

The servlet spec provides a convenience method for the content type.
The content disposition can be set with the setHeader method.

Here is an example for an Excel file.

[ March 10, 2006: Message edited by: Ben Souther ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!