Forums Register Login

methods would you use to retrive header values from request

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
If you want to be really sure of this, always refer to java api:
Java 2 Enterprise Edition 1.4
+Pie Number of slices to send: Send
There is not such method getHeaderValues()in API under HttpServletrequest.
+Pie Number of slices to send: Send
Damn....i always get shot on this question!
Too many men are afraid of being fools - Henry Ford. Foolish tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 621 times.
Similar Threads
doubt from hanumant book
getHeaders And getRequestDispatcher
Question about "getHeaderValue()"
getHeaders(s) or getHeaderValues(s)?
getHeaders and getRequestDispatcher
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 02:27:17.