what is the diff between Servletcontext and servletconfig?

Answers were Sorted based on User's Feedback



what is the diff between Servletcontext and servletconfig?..

Answer / monisha

ServletContext is created only once in a whole application
whereas servletConfig is created for each servlet in an
application.

Is This Answer Correct ?    13 Yes 0 No

what is the diff between Servletcontext and servletconfig?..

Answer / abdul mannan

In ServletContext value will b same for whole application
and were as the servletConfige value will b seprate or
diffrant for all the application in the project..

Is This Answer Correct ?    6 Yes 0 No

what is the diff between Servletcontext and servletconfig?..

Answer / srinu

servletcontext:
1) servletcontext object one for webapplication
2)it used global init parameters
3)with help servletcontext object we find our webserver
ingformation(public java.lang.String getServerInfo())

servletConfig:

1)servletConfig object will be created every servlet suppose
in my webapplication 10 servlets are their 10 servletConfig
object will be created but only one SwervletContext object
will be created
2) it is the righthand object of servlet
3)it used local init parameters
4)with help of servletConfig object we find out logical name
of servlet(public java.lang.String getServletName())

Is This Answer Correct ?    4 Yes 0 No

what is the diff between Servletcontext and servletconfig?..

Answer / srinivasa

Every web application has only one SContext object.
There are n number of SConfig objects in an Web app where
n is the number of servlets. It is specific to a servelt.
ServletContext is used to get the context parameters.
ServletConfig is used to get to the init parameters.

Is This Answer Correct ?    2 Yes 1 No

what is the diff between Servletcontext and servletconfig?..

Answer / sreenu karampudi

ServletContext: One Object(ServletContext) for application
ServeltConfig: It is specifig to a servelt in an
application. Each servlet will have a ServletConfig

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

hoe can u call a constructor of a private classs to other inherited claa??

1 Answers  


What are different type of access modifiers?

3 Answers  


What do u mean by variable?

0 Answers  


What is the type of lambda expression?

0 Answers  


Why enumeration is faster than iterator?

0 Answers  






whatis Home interface and Remoteinterface? with example?

0 Answers   Saksoft,


How many arguments can be passed to main ()?

0 Answers  


Is it possible to do method overloading and overriding at a time

3 Answers   L&T,


what is main difference between architecture,framework and design pattren

3 Answers  


What is data abstraction? Elaborate with example?

4 Answers   BMC, TCS,


How to create two different thread class inside a main function?

1 Answers  


Is there a jre for java 11?

0 Answers  


Categories