aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes 3 simple servlet  test questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "3 simple servlet  test questions" Watch "3 simple servlet  test questions" New topic
Author

3 simple servlet test questions

Stephen Lim
Greenhorn

Joined: Jul 30, 2003
Posts: 15
These are not taken from any certified exams, but belonging to a assessment test for registration purpose.
Can you guys pls let me know what are the answers or them? (I find the questions to be simple yet not precise per the Servlet APIs)
QUESTIONS: -
1. Which corresponding method in the HttpServlet class do you use to retrieve the value of a text field on an HTML form?

A. doPost

B. getParameter(String fieldName)

C. getHTTP(String fieldName)

D. doGet(String fieldName

2. What causes a servlet to load (2 options, choose the simplest/least operational impact)

A. A Web server start

B. The container detects that a class file has changed.

C. It is configured to do so periodically

D. It is loaded upon every request

3. Which interface defines the methods for retrieving form parameters

A. ServletRequest

B. ServletResponse

C. HTTPRequest

D. HTTPResponse
(This question seems to be quite funky as none of the options are 'interface' in the J2EE 1.3 APIs, right?)


Warm regards,<p>Stephen Lim
Yuan Ye
Ranch Hand

Joined: Mar 05, 2003
Posts: 172
My answer would be 1.A 2.AC 3.A ( it is an interface).
Shishio San
Ranch Hand

Joined: Aug 29, 2002
Posts: 223
1. B
2. A,B (A: still it has to be configured in the web.xml to load at start-up)
3. A
Originally posted by Stephen Lim:

A. ServletRequest

B. ServletResponse

C. HTTPRequest

D. HTTPResponse
(This question seems to be quite funky as none of the options are 'interface' in the J2EE 1.3 APIs, right?)[/QB]

These are all interfaces.


Whatever doesn't kill us ...<br />Is probably circling back for another try.<br />SCJP 1.4
francisk
Greenhorn

Joined: Feb 18, 2002
Posts: 8
1. A
Because it said HttpServlet class. If it said ServletRequest, I will pick B. getParameter()
2. A, B
When the deployment descriptor file have specified <load-on-startup>, it will load when web server start, otherwise it will load when the first request comming in.
3. A
Dani Mazzuca
Ranch Hand

Joined: May 21, 2003
Posts: 70
Hi,
definitively
1 - B
2 - A and B
3 - A (it is an interface)
Dani
Vedhas Pitkar
Ranch Hand

Joined: Jan 27, 2001
Posts: 445
1.A
2.B,C
3.Should be HttpServletRequest
Amer Khan
Ranch Hand

Joined: Apr 05, 2003
Posts: 163
Methods for retrieving form parameters are defined in the ServletRequest interface(SR interface is implemented by the container).


<i>Dare to dream - everything that exists today,was once a figment of someone's imagination, nobody says tomorrow can't be a figment of your today.</i>
Amer Khan
Ranch Hand

Joined: Apr 05, 2003
Posts: 163
A, tricky ? (There is no getParameter(String str) defined or inherited in HttpServlet class ,this method is defined in ServletRequest interface and is accessed through the HttpServletRequest object[interface HttpServletRequest extends interface ServletRequest )]NOTE:Both interfaces are implemented by the Container
B,C (<load-on-startup> in web.xml)
A, Methods for retrieving form parameters are defined in the ServletRequest interface(SR interface is implemented by the container).
[ August 05, 2003: Message edited by: Amer Khan ]
Meghasyam Bokam
Greenhorn

Joined: Feb 27, 2003
Posts: 16
Hi moderator,
different people gave different answers. Can you please provide the right answers for the above questions.


Regards,<br />Meghasyam.<p>SCJP1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 3 simple servlet test questions
 
Similar Threads
J2EE Recommended Reading
can any one help me in finding wrong answers
Passed 700,701 and 340 last Thursday
Test 484 ... LONG POST
Test 340 Answers