Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming 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

P3P compliance-Tomcat HTTP response headers

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I am in the process of making our site P3P compliant. We are running Tomcat 3.2.2(stand alone) on a Linux box. I am looking for information regarding adding data to HTTP header responses(see example below). One of the aspects of P3P compliancy is referencing where a Policy is located and referencing the "Compact Policy" via the "CP" tag. I need to add these values and as I am new to Tomcat I need know where to find the header information.
<!-- example -->
HTTP/1.1 200 OK
P3P: policyref="http://somesite.com/P3P/PolicyReferences.xml",
CP="NON DSP COR CURa ADMa DEVa CUSa TAIa OUR SAMa IND"
Content-Type: text/html
Content-Length: 8104
Server: ...
...content...
<!-- end example -->
Any suggestions would be appreciated.
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Joe D",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Joe D
Use the response.setHeader( name, value ) method to set your required header.
Use the request.getHeader( name ) if you need to locate a header.
Bill
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply, I really need a "server-wide" solution. I am looking for something similar to modifying a header on Apache. I am using Tomcat stand-alone, so there is no Apache interaction.
 
Sasparilla and fresh horses for all my men! You will see to it, won't you tiny ad?
Level Up Your Code with a Pro Java IDE
https://www.jetbrains.com/idea
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!