what is the difference between ServletContext and
ServletConfig?

Answers were Sorted based on User's Feedback



what is the difference between ServletContext and ServletConfig?..

Answer / devarathnam chinnakotla. banga

Hi,

ServletContext: ServletContext is a view of webapplication,
there will be only one servletcontext for one
webapplication. It acts as shared memoty area, all the
components of a webapplication can access the data from
servletcontext object.

ServletConfig: ServletConfig will be specific to each
servlet. If your webapplication contains 20 servlets then,
there will be 20 servletsconfig objects.

Is This Answer Correct ?    8 Yes 3 No

what is the difference between ServletContext and ServletConfig?..

Answer / sunil kumar- vizag

Servlet Context: Servlet Context defines a set of methods
that a servlet uses to communicate with its servlet container.

Servlet Config: A servlet configuration object used by a
servlet container passes information to a servlet during
initialization.

Is This Answer Correct ?    7 Yes 2 No

what is the difference between ServletContext and ServletConfig?..

Answer / raghu

Servlet Context -> It is one for the web application.
Servlet Config -> It is one for the Servlet.

Is This Answer Correct ?    5 Yes 1 No

what is the difference between ServletContext and ServletConfig?..

Answer / durairaj

ServletContext represents the unique configuration of particular webapplication in the WebContainer.The parameters set in the ServletContext can be retrieved universally in the particular webapplication

ServletConfig represents the unique configuration of a particular Servlet in the Webapplication.The parameters set in the ServletConfig can be retrieved universally in the particular Servlet class only(not outside)

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More Struts Interview Questions

1.can we transfer a request from one struts application to another struts application? 2. how many types of action servlets r there what r they

0 Answers   TCS,


What is the difference in using Action interface and ActionSupport class for our action classes, which one you would prefer?

0 Answers  


I will explain the scenario now i have a form1 having some fields and i made it extends DynaActionForm. in struts config how can i specify another form form2 which has to extend the form1 please specify is it better to use actionform or dyna action form in applations. is dyna action form is comfortable in declaring form variables of type 'ArrayList<somegenerics>' extend the

0 Answers   Techno Solutions,


What are the core classes of the struts framework?

0 Answers  


What is includeaction?

0 Answers  






Explain the difference between plain-validator and field-validator in struts?

0 Answers  


What is the purpose of @requiredstringvalidator?

0 Answers  


What does i18n interceptor?

0 Answers  


What is the difference between struts and spring? Explain

0 Answers  


Explain about the process of functioning of the struts program?

0 Answers  


In struts.xml, what does the attribute "method" stands for in the "action" tag?

0 Answers  


What is the difference between shocks and struts?

0 Answers  


Categories