Win a flower (🌹) or copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java (📚) this week in the Agile and Other Processes 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
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
master stewards:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
garden masters:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
gardeners:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

methods would you use to retrive header values from request

 
pioneer
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Following is a question from Manning Book
page 65
question 7
Q Which of the following methods would you use to retrive header values from request (select two)

a getHeader() of ServletRequest
b getHeaderValues() of ServletRequest
c getHeader() of HttpServletRequest
d getHeaders() of ServletRequest
e getHeaders() of HttpServletRequest

Ans:b nad e


I think c and e are correct.
b is wrong.

I think there is no getHeaderValues()in ServletRequest. I referring tomcat 4.1 docs.


java.util.Enumeration getHeaders(java.lang.String name)
Returns all the values of the specified request header as an Enumeration of String objects.


java.lang.String getHeader(java.lang.String name)
Returns the value of the specified request header as a String.


Please correct me if i an wrong.
 
pioneer
Posts: 244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to be really sure of this, always refer to java api:
Java 2 Enterprise Edition 1.4
 
Satyajeet Kadam
pioneer
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is not such method getHeaderValues()in API under HttpServletrequest.
 
pioneer
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Damn....i always get shot on this question!
 
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!