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.