About Question enthuware.jwpv6.2.705 :

Moderator: admin

Post Reply
ETS User

About Question enthuware.jwpv6.2.705 :

Post by ETS User »

The answer and explaination to this question appears to be incorrect .

The getInitParameter method must be called on the servletconfig object NOT the servlet object.

admin
Site Admin
Posts: 10385
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.705 :

Post by admin »

HttpServlet implements ServletConfig interface and so this.getInitParameter("DBURL"); is valid in a servlet.

HTH,
Paul.

jmkenny
Posts: 8
Joined: Sun Jun 02, 2013 11:04 am
Contact:

Re: About Question enthuware.jwpv6.2.705 :

Post by jmkenny »

I would rather say GenericServlet implements ServletConfig interface and HttpServlet extends GenericServlet.

PMiglani
Posts: 14
Joined: Sat Jan 19, 2013 8:42 am
Contact:

Re: About Question enthuware.jwpv6.2.705 :

Post by PMiglani »

Do I need to assume here that servletcontext is a variable pointing to ServletContext Object. There is nothing mentioned about it in the question.

admin
Site Admin
Posts: 10385
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.705 :

Post by admin »

There is already a statement saying, "(Assume that servletcontext is a reference to ServletContext for this servlet.)" at the of the problem statement.

HTH,
Paul.

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests