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 ]