• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

response.setHeader(xxx, xxx)

 
Matt Midcap
Sheriff
Posts: 440
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I understand how you can set the header in the HttpServletResponse object with:
public void setHeader(java.lang.String name, java.lang.String value)
I am trying to find out where there is a key or table telling what the "values" available to put in the second arg.
Thanks,
Matt
[This message has been edited by Matt Midcap (edited December 13, 2000).]
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe you can have any valid string value as the parameter to the setHeader method.
Bosun
 
Matt Midcap
Sheriff
Posts: 440
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bosun,
Maybe I'm not understanding the way setHeader works. I thought the "value" arg would be a predefined argument. For example, if I was trying to set the header to a ".pdf" file, I would have to find out what value corresponded to a .pdf file. So I'm looking for something like:
If you want:|-file type-|-use this value-|
------------------------------------------
-html-------|--"HTML"---|---"HTML"-------|
------------------------------------------
-pdf--------|--"pdf"----|---"pdf"--------|
------------------------------------------
Or am I completely wrong???
[This message has been edited by Matt Midcap (edited December 13, 2000).]
 
maha anna
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matt,
Your doubt is valid one. The 2nd arg of response.setHeader(..) method is of 'mainType/subType' format where mainType and subType are officially registered names for applications.
The following link has the Table format as you guessed right.
I got it from Marty Hall's book.
regds
maha anna

[This message has been edited by maha anna (edited December 13, 2000).]
 
Matt Midcap
Sheriff
Posts: 440
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
THANKS MAHA!!!
I owe you!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic