Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

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: 67340
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
 
Destroy anything that stands in your way. Except this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!