About Question enthuware.jwpv6.2.810 :

Moderator: admin

Post Reply
tori3852
Posts: 38
Joined: Wed Oct 31, 2012 2:53 am
Contact:

About Question enthuware.jwpv6.2.810 :

Post by tori3852 »

Option is marked as incorrect:
They can be modified using the setInitParameter() method.
Not sure about this – ServletContext has setInitParameter method, but it is only allowed to be set during initialization. Same with Servlet init parameter.

By the way – on Tomcat 7 I was able to set new context/servlet init parameters in servlet's service() method (which is wrong according to API), but I guess this is Tomcat specific.

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

Re: About Question enthuware.jwpv6.2.810 :

Post by admin »

Yes, the setInitParameter method can be used only before the servlet is initialized.
Also, as per the javadoc, it returns false if it was not set because this ServletContext already contains a context initialization parameter with a matching name. That means it cannot be modified.

-Paul.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests