what is the diff between Servletcontext and servletconfig?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is string builder?

464


How do you print array in java?

552


Can you instantiate the math class in Java?

602


Difference between object and reference?

676


Which is better 64 bit or 32 bit?

505






How many classes can any class inherit java?

504


Which class cannot be a subclass in java?

537


What is java jit compilers?

556


What is boolean logic?

559


How can a gui component handle its own events?

587


Can subclass overriding method declare an exception if parent class method doesn't throw an exception?

501


Can we overload final method in java?

544


Can a method inside a interface be declared as final?

520


What is integer parseint?

544


What does a boolean method return?

623