JSP Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 775 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 ShJsXK
Related Questions
JSP : Can you stop JSP execution in the middle of processing a request?

Can you stop JSP execution in the middle of processing a request?

Yes, by using the return statement to stop the processing of JSP. Where JSP is compiled to servlet a....
Category: JSP Date: 11/4/2010 2:47:57 PM
JSP : What is the difference between ServletContext and PageContext?

What is the difference between ServletContext and PageContext?

ServletContext gives the information about the container and PageContext gives the information about....
Category: JSP Date: 11/4/2010 2:14:57 PM
JSP : What is the difference between GET and POST?

What is the difference between GET and POST?

In GET data is empedded in one URL, like a hyperlink. query length is limited to 255 characters, not....
Category: JSP Date: 11/4/2010 1:42:56 PM
JSP : What is a Session Id?

What is a Session Id?

It is a unique id assigned by the server to the user when a user starts a session.
Category: JSP Date: 11/4/2010 11:53:58 AM
JSP : How can we set the inactivity period on a per-session basis?

How can we set the inactivity period on a per-session basis?

By using the method setMaxInactiveInterval() of HttpSession.
Category: JSP Date: 11/4/2010 11:20:57 AM