March 2008
Intermediate to advanced
911 pages
20h 31m
English
How would servlet code from a service method (e.g., doPost() ) retrieve the value of the “User-Agent” header from the request? (Choose all that apply.)
( API)
| A. | String userAgent = request.getParameter("User-Agent"); |
| B. | String userAgent = request.getHeader("User-Agent"); |
| C. | String userAgent = request.getRequestHeader("Mozilla"); |
| D. | String userAgent = getServletContext().getInitParameter("User-Agent"); |
-Option B shows the correct method call passing in the header name as a String parameter.
Which HTTP methods are used to show the client what the server is receiving? (Choose all that apply.)
(HF 4, HTTP methods)
|
| GET |
|
| PUT |
|
| TRACE |
|
| RETURN |
| OPTIONS |
-This method is typically ...
Read now
Unlock full access