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 / rajendra singh bisht

You can get reference to ServletContext through ServletConfig. HttpSession does not provide a reference to ServletContext object.

To get a ServletContext object use

getServletConfig().getServletContext();

or you can call directly getServletContext() bcoz GenericServlet class implements ServletConfig interface also.

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the two important api's in for servlets?

1088


What are the different mode that servlets can be used?

1020


Which interface should be implemented by all servlets?

1217


Why servlet is used as controller ? Not JSP? I want complete explation?

1136


Is servlet synchronized?

1089


Is servlet thread safe?

994


Why do we have servlet wrapper classes?

1070


How to rectify errors in java servlet while compilation?

959


What is servlet in simple terms?

1025


Explain Action Servlet?

1088


Define servlet mapping?

1166


What is httpservlet class?

1144


What is a web application and what is it’s directory structure?

1081


What is the difference between jsp and servlet life cycle?

1223


List some life cycle methods of a servlet.

1067