Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding cookies and headers (P3P) error

 
J.H.B. Oosterlaar
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have the following piece of code implemented within a servlet:

I get a 503 error from TomCat when requesting the servlet. When I remove one of the two (cookie of header addition) it works fine. It doesn't matter whether I add the cookie first, or the header. What's wrong here?
Thanks
 
chanoch wiggers
Author
Ranch Hand
Posts: 245
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i looked into this when i first saw this problem. Have you tried swapping round the code so that you add all headers before adding the cookie?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic