• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

response.setHeader(xxx, xxx)

 
Sheriff
Posts: 440
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Ranch Hand
Posts: 1512
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
THANKS MAHA!!!
I owe you!
 
reply
    Bookmark Topic Watch Topic
  • New Topic