Wrox Programmer Forums
|
Apache Tomcat General discussion of the Apache Tomcat servlet container. For discussions specific to the Professional Apache Tomcat book, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Apache Tomcat section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 26th, 2004, 02:52 PM
Registered User
 
Join Date: Mar 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Tomcat HTTP Headers

I need Tomcat to send a customized HTTP header all the time. Is there a way to do this?

Thanks in advance.

 
Old April 10th, 2004, 06:11 PM
Registered User
 
Join Date: Apr 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to nicku
Default

Yes, route all requests through a certain servlet where u set appropriate header fields with standard java HttpServletRequest API, e.g. setHeader(name, value). You can do it for static resources (.html,.js,.gif..) also by registering a servlet for "/" path in your webapp. The Tomcat servlet doing that (static res serve) for all webapps by default is StandardServlet which u have to extend to make your own header logic in doGet and/or doPost and afterwards forward to tomcat;s code by calling super.doGet..helps u out a bit?
Of course in jsp, if not included in the response of another jsp/servlet u have to do setHeader and equivalent there.

-------------
Nicu Marasoiu
java programmer





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with HTTP Headers in servlet vs ASP javajed Servlets 3 November 15th, 2011 03:47 AM
Access underlying HTTP headers in web service. glen205 .NET Web Services 0 November 27th, 2006 07:36 PM
http gzip compreses in tomcat wakeup Servlets 0 April 24th, 2006 09:26 AM
WHat is "http headers"? gilgalbiblewheel Classic ASP Databases 1 September 14th, 2005 11:59 AM
http headers in asp ocabrera70 Classic ASP Basics 2 April 26th, 2005 08:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.