Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between servlet config and servlet
context.

Answer Posted / srikanth

ServletConfig :-

-> one per servlet or one per JSP

-> this object is usefull to pass additional information to
servlet and to gather information about servlet. so this
object is called right hand object of servlet or JSP
program.

-> servlet container creates and distroyes this obj with
respact to our servlet obj creation and distraction.

-> Non java web resource programs of web applications
does't contain ServletConfig obj.

->ServletConfig obj means it is the ibj of class that
implements javax.servlet.ServletConfig interface. this
class name changes based on the web server or application
server we use.

->this obj is usefull to read intilization parameters of
servlet that are configared in the web.xml file.



ServletContext :-

-> one per web application.

->ServletContext obj and its data is visable and accessble
in the all the web resoure programs of web application. So
ServletContext obj is also called as global memory of the
web application.

->Servlet container creates this ServletContext obj during
the deployment of web application and distroys this obj
when web application is stoped or reloaded or undeployed.

->ServletContext obj is very usefull

a) to gather global inti parameters / context parameters
from web.xml file.

b) to know the details about underlaying server where
the web application is deployed.

c) to know the web resource programs of the web
application

->ServletContext obj means that is obj of a class which
inplements javax.servlet.ServletContext interface. this
implementation calss name will change base on the web
server or application server we are useing.

Is This Answer Correct ?    10 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by deployment descriptor?

1056


What is servlet in web technology?

1047


What is meant by Servlet? What are the parameters of service method?

1054


Can we override servlet service method?

1097


Write a program to show the functionality of doget and dopost method?

1219


Explain the jar and war files in servlet?

1101


How we can call a jsp from the servlet?

1008


If a servlet is not properly initialized, what exception may be thrown?

1182


What is the importance of init() method in Servlet ?

1080


How do you get the ip address of the client in servlet?

1010


How to get the actual path of servlet in server?

1221


What is the use of servletconfig interface?

1046


Is servlet a framework?

1039


What do you mean by url pattern in servlet?

1114


Explain is servlet mapping?

1008