Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About Headers

 
Charmy Madhvani
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am maintaining one of the application whose Home page(jsp) is actually getting the authentication info like username , userid from the Headers(request.getHeaders()). This home page is actually navigated from some other portal site which I am not allowed to access. So there is no way to know how that portal is setting the custom header info in the request which we are getting in our Home page. Does anybody has idea how can my system get the customized header info? Infact how can one setHeader in one page and getHeader in another?
 
Charmy Madhvani
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have seen that API.
Let me be more clear.

There is an application in a separate server(WSSO).It sets a header information called USERNAME. Its jsp has a link to my application(Tomcat4.1). When that link is clicked the request comes to my jsp. In my jsp I am getting a non null value from from request.getHeader("USERNAME").
My question in how did that jsp from another application able to setHeader in request? Can a specific server provides any API to do that. Because nothing like this can happen in JSP/Servlets API.

I hope I have made myself clear..
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My question in how did that jsp from another application able to setHeader in request?


I dont think that is actually happening here. Headers can only be set by the application generating the request. If this was my problem I would "view source" on the page that links to your jsp to see what is actually generating the request.

Bill
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because nothing like this can happen in JSP/Servlets API.


Not entirely true.
You could write a filter that sets this header.
[ January 16, 2008: Message edited by: Ben Souther ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, if you don't have it yet, you might want to install the LiveHttpHeaders or FireBug plugin for Firefox. Both of these tools will allow you to see the request and response headers for all web requests going to and from your browser.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic