• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

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

 
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.
 
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 ]
 
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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
 
money grubbing section goes here:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic