aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes JavaRanch MockExamQuestion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "JavaRanch MockExamQuestion" Watch "JavaRanch MockExamQuestion" New topic
Author

JavaRanch MockExamQuestion

Divya Guttikonda
Ranch Hand

Joined: Mar 09, 2005
Posts: 47
Here is a Mock Exam Question from JavaRanch:

A client types the URI :
http://www.someserver.com/servlet/SomeServlet?name=fred
The value of name can be obtained by:

a)doGet(HttpServletRequest request, HttpServletResponse response)
{
String name = response.getParameter("name");
...


b) service(HttpServletRequest request, HttpServletResponse response)
{
String name = request.getParameter("name");
...


c)doGet(HttpServletRequest request, HttpServletResponse response)
{
String name = request.getInitParameter("name");
...


d)doGet(HttpServletRequest request, HttpServletResponse response)
{
String name = request.getParameter("name");
...

The answer given is b, but i think the correct answer is d.Can anybody help me with this?

Thanks
Divya.
Sirisha Reddy
Ranch Hand

Joined: Jun 09, 2003
Posts: 75
i dont see why d is not correct answer ?!


SCJP 1.4
shiva viswanathan
Ranch Hand

Joined: Aug 12, 2004
Posts: 152
Hey I think both b and d are correct answers since ultimately the service method calls the doGet method passing the same HttpServletRequest
method
 
jQuery in Action, 2nd edition
 
subject: JavaRanch MockExamQuestion