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 important features of Servlet 3?

1086


Elucidate servlet attributes and its scope?

1007


How to commuincate between an applet and a servlet?

1048


How to handle exceptions thrown by application with another servlet?

1084


Explain jsessionid and when is it created?

1107


What are the kinds of http requests?

1033


How do you create a cookie using servlet?

1165


Write a simple servlet program to print the contents of html.

1042


Why do you use session tracking in httpservlet?

1127


What are the benefits of using servlet over cgi?

1045


How do we share data using 'getservletcontext ()?

1036


What is the difference in between the httpservlet and generic servlet?

1117


How can an existing session be invalidated?

1163


Is servlet a framework?

1033


Is servlet thread safe?

982