Question 1) Sun Certified for J2EE Platform 1.4
Objective : The Structure and Deployment of Web Applications
SubObjective : * Using the HttpServletRequest interface, write code to retrieve HTML form parameters from the request, retrieve HTTP request header information, or retrieve cookies from the request
Single Answer Multiple Choice
You should use the request.getHeader(“User-Agent”) method call to retrieve the browser type from the request header. This method call returns the user agent that generated this request. The user agent may be a browser or another program. If it is a browser, the value will contain the name of the browser. If it is another program, the value will contain the name of the program as defined by the developer of the program.
The request.getParameter method is used to obtain parameter values from a form submitted by the end user.
The request.getInitParameter method is used to obtain initialization values from the deployment descriptor of a Web application.
The getHeader method cannot accept the parameter Browser-Type. There is no such standard header defined by any specification. However, it could be a custom header. In such a scenario, the getHeader method cannot contain the browser type information by convention.
These questions are derived from the Self-Test Software Practice Test for 310-081 – Sun Certified Web Component Developer for J2EE Platform 1.4 .