• Post Reply Bookmark Topic Watch Topic
  • New Topic

Storing ServletContext init param in <distributable> webapp  RSS feed

Kamal Tripathi
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a distributed environment, which of the following is recommended for storing the initialization parameters pertaining to the Servlet Context?
a. The values of the Initialization parameters can be stored in the Application itself.
b. The values have to be externalized to other storage locations like database or a file.
c. The storage of the values to any location doesn't have any impact in a distributed environment.
d. None of the above.

Answer: B.

In a distributed environment, it is also advisable to store the values of the initialization parameters in external storage (like database or file), because if stored at the Application level, it is not also guaranteed that all the Containers will always have the same state.

However I marked the answer as D since even external storage is not required. There is no such method as setInitParameter so whatever be the values they can't be different so will be automatically "in sync" owing to this very basic nature. What do you all think ??
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!