JSP Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 1030 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 ekGOtP
Related Questions
JSP : Can we use the constructor, instead of init(), to initialize servlet?

Can we use the constructor, instead of init(), to initialize servlet?

Yes. But you will not get the servlet specific things from constructor. The original reason for init....
Category: JSP Date: 11/7/2010 7:18:56 AM
JSP : Can I use multiple HTML form elements with the same name?

Can I use multiple HTML form elements with the same name?

Yes. Define the element as an array and Struts will autopopulate it like any other. private String[]....
Category: JSP Date: 11/7/2010 6:02:00 AM
JSP : How to pass information from JSP to included JSP?

How to pass information from JSP to included JSP?

By using <jsp:param> tag
Category: JSP Date: 11/7/2010 2:02:57 AM
JSP : How can you initialize a newly instantiated bean by using a scriptlet?

How can you initialize a newly instantiated bean by using a scriptlet?

If there is a body (where jsp:useBean action may optionally have a body), its contents will be autom....
Category: JSP Date: 11/7/2010 1:29:57 AM
JSP : What is the difference between an application server and a web server?

What is the difference between an application server and a web server?

Application server provides a lot of services like security, transaction , scalability. Application ....
Category: JSP Date: 11/6/2010 11:39:59 PM