To get the servlet environment information

Options
- ServletConfig object is used
- ServletException object is used
- ServletContext object is used
- ServletContainer object is used


CORRECT ANSWER : ServletContext object is used

Discussion Board
ServletContext object

ServletContext object is created by web container at time of deploying the project. It is used used to get configuration information from web.xml file. There can only be one ServletContext object per web application. If any information is shared to many servlet then it is better to provide using web.xml file using the context given as: <context-param> element. This also provides the servlet environment information and it is easy to maintain the shared information between all the servlet.

Rohit Sharma 11-27-2014 04:37 PM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement