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 meant by object oriented programming – oop?

775


What is static in java?

821


What is a lambda expression ? What's its use ?

842


List the interfaces which extends collection interface?

755


I am unable to find or learn about print command. I have a graphical program in core java in applet but i want to give print command but i have coding for that so if anyone know about this plz mail me on avdhesh_chauhan007@yahoo.co.in

1848


What are the data types supported by java?

781


What is the purpose of return statement?

850


What are the different types of garbage collectors in java?

838


What is the difference between the final method and abstract method?

808


How can we find the actual size of an object on the heap?

1091


Write down program for following scenario. Use java coding standard. You have array list with some words in it..we will call it as dictionary….and you have a arbitrary string containing some chars in it. You have to go through each word of dictionary and find out if that word can be constructed with the help of chars from arbitrary string given. If you find the word print it else print none.

2506


What is use of super keyword?

766


Why are getters and setters used?

803


What is a substring of a string?

839


How do you avoid global variables?

804