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

Explain jsessionid and when is it created?

1048


Which http method is said to be non-idempotent and idempotent?

1001


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

1147


What are the types of servlets? Explain

1198


Tell the new features added in servletrequest interface i.e. Servlet 2.4

1119


How can you start a jta transaction from a servlet deployed on jboss?

1105


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

1030


What is cgi and what are its drawbacks?

984


request parameter how to find whether a parameter exists in the request object?

957


When servlet is loaded?

1033


How servlets are deployed in java?

968


What are the servlet events?

1010


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

1069


What do you mean by url pattern in servlet?

1071


How do you deal property files in servlet?

1015