Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to set browser title using HTTP Header from a Servlet?

 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,
I have a servlet that serves PDF documents. The servlet reads the pdf file,set the header content to application/pdf and sends the file data using response.getOutputStream().
It works fine and the PDF document is openend with in the IE browser using the plugin. I like to do two things:
1) Change the title of the IE browser window to the PDF file name
2) When I press the "Save" button with in the Acrobat Reader application, I want the "Save As" dialog to contain pdf file name in the text field: "File name". Right now it appears as *.pdf.
Any help is greatly appreciated.
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The title of the browser window always comes from the <title> element of an HTML page.
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do see a HTTP header parameter named "Title". It doesn't seem to display the title after I set the value.
[ July 28, 2003: Message edited by: Sai Prasad ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The HTTP headers and the HTML <header> are not the same thing...
hth,
bear
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic