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...

Is there any differance b/w getting servlet context from
servlet config and session? if yes then what is that?

Answer Posted / sandhya

YES,There is some difference,when we deploy the web
application the web container will create the Context
object and when we load the servlet class then container
will create config object,so for each web application web
container will create one servlet context obj and for each
servlet web container will create servlet config object.

Generally we use this objects to avoid the hardcoding,we
declare this variables in deployment descriptor,we declare
context parameters under web-app tag so that all servlets
can use this parameter values ,and config parameters under
servlet tag so that only specific servlet can use this
parameter values,in simple way context object is like
global object and config obj is like local obj.

Is This Answer Correct ?    8 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the process for chaining servlet?

1047


Write a hello world program using servlets.

1063


What are the different mode that servlets can be used?

1018


How to get ip address in jsp login page and how to validate like 127.1.0.1 all should not be greater than 255

3395


Why do we use sendredirect() method?

971


Write all the phases defined in servlet life cycle?

1151


what is the different between a servlet and a cgi? Why do you go for servlet rather than cgi?

1045


How servlets are deployed in java?

1018


Is servlet a framework?

1038


Whether we can get deadlock situation in servlets?

1070


Explain servlet events?

1008


Who is responsible for writing a constructor?

1265


What are the different ways we can maintain state between requests?

1096


What do you mean by the servlet chaining?

1078


What is servlet and its advantages?

1048