JSP Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 676 Page Views: 

How can you get a servlet context?



Posted By: Avi Date: 8 November 2010 01:50:57 AM
 Answer:

By calling getServletConfig ().getServletContext (). By calling this.getServletContext () also we will get a ServletContext object.


Posted By: avibtech


Date: 8 November 2010 01:50:57 AM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image 5zC1yt
Related Questions
JSP : How setting a cookie?

How setting a cookie?

Cookie c = new Cookie("name","value"); response.addCookie(c);
Category: JSP Date: 11/8/2010 7:50:57 PM
JSP : How can a servlet refresh automatically?

How can a servlet refresh automatically?

By using client-side refresh or server push.
Category: JSP Date: 11/8/2010 7:17:57 PM
JSP : What is a servlet filter?

What is a servlet filter?

Servlet filters are pluggable web components that used to implement pre-processing and post-processi....
Category: JSP Date: 11/8/2010 6:00:59 PM
JSP : How can my application get to know when a HttpSession is removed?

How can my application get to know when a HttpSession is removed?

By defining a class which implements HttpSessionBindingListener and override the valueUnbound() meth....
Category: JSP Date: 11/8/2010 4:55:58 PM
JSP : What is the difference between setting the session time out in deployment descriptor and programmatically?

What is the difference between setting the session time out in deployment descriptor and programmati....

deployment descriptor time out is specified in terms of minutes only and the session time out value ....
Category: JSP Date: 11/8/2010 4:22:57 PM