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.
About Question enthuware.jwpv6.2.705 :
Moderator: admin
-
- Site Admin
- Posts: 10105
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.705 :
HttpServlet implements ServletConfig interface and so this.getInitParameter("DBURL"); is valid in a servlet.
HTH,
Paul.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 8
- Joined: Sun Jun 02, 2013 11:04 am
- Contact:
Re: About Question enthuware.jwpv6.2.705 :
I would rather say GenericServlet implements ServletConfig interface and HttpServlet extends GenericServlet.
-
- Posts: 14
- Joined: Sat Jan 19, 2013 8:42 am
- Contact:
Re: About Question enthuware.jwpv6.2.705 :
Do I need to assume here that servletcontext is a variable pointing to ServletContext Object. There is nothing mentioned about it in the question.
-
- Site Admin
- Posts: 10105
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.705 :
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.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 0 guests