JSP Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 856 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 dM9lEX
Related Questions
JSP : Can we useĀ  ServletOutputStream object from a JSP page?

Can we useĀ  ServletOutputStream object from a JSP page?

No. 
Category: JSP Date: 11/3/2010 11:31:57 AM
JSP : How to refer the "this" variable within a JSP page?

How to refer the "this" variable within a JSP page?

The page implicit object page is equivalent to "this", and returns a reference to the serv....
Category: JSP Date: 11/3/2010 8:37:57 AM
JSP : How do you pass data from a servlet to a JSP?

How do you pass data from a servlet to a JSP?

By forwarding the request to the servlet ( the data must be there in the request scope) or using a s....
Category: JSP Date: 11/3/2010 5:43:57 AM
JSP : What is the difference between ServletContext and ServletConfig?

What is the difference between ServletContext and ServletConfig?

The ServletContext gives information about the container, provides information to servlets regarding....
Category: JSP Date: 11/3/2010 5:10:57 AM
JSP : What is use of parseQueryString?

What is use of parseQueryString?

It parses a query string and builds a Hashtable of key-value pairs, where the values are arrays of s....
Category: JSP Date: 11/3/2010 3:21:58 AM