JSP Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 850 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 lJPvMW
Related Questions
JSP : What is the difference between using request.getRequestDispatcher() and context.getRequestDispatcher()?

What is the difference between using request.getRequestDispatcher() and context.getRequestDispatcher....

We use request.getRequestDispatcher(path) when we need to give the relative path of the resource and....
Category: JSP Date: 11/6/2010 1:19:56 PM
JSP : Can we implement an interface in JSP ?

Can we implement an interface in JSP ?

No
Category: JSP Date: 11/6/2010 10:57:57 AM
JSP : Why are my checkboxes not being set from ON to OFF?

Why are my checkboxes not being set from ON to OFF?

A problem with a checkbox is that the browser will only include it in the request when it is checked....
Category: JSP Date: 11/6/2010 6:47:00 AM
JSP : What's the difference between forward and sendRedirect?

What's the difference between forward and sendRedirect?

forward is server side redirect; when it is invoked, the request is sent to another resource on the....
Category: JSP Date: 11/6/2010 4:35:56 AM
JSP : How do you communicate between the servlets?

How do you communicate between the servlets?

By using RequestDespatcher interface and servlet chaining.
Category: JSP Date: 11/6/2010 2:13:58 AM