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

What is the difference between ServletContext and ServletConfig?



Posted By: Avi Date: 3 November 2010 05:10:57 AM
 Answer:

The ServletContext gives information about the container, provides information to servlets regarding the environment in which they are running and provides standard way for servlets to write events to a log file. The ServletConfig gives the information about the servlet initialization parameters and is used to pass configuration information to a servlet; where the servlet engine implements it.


Posted By: avibtech


Date: 3 November 2010 05:10: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 48nWVm
Related Questions
JSP : What is a Scriptlet?

What is a Scriptlet?

A scriptlet is a tag that can contain any java code that are valid inside a normal java method as li....
Category: JSP Date: 11/7/2010 1:07:56 PM
JSP : What is the web container?

What is the web container?

Web containers are Servlet and JSP container.
Category: JSP Date: 11/7/2010 11:51:59 AM
JSP : What will event be notified when a session object gets added or removed to the session?

What will event be notified when a session object gets added or removed to the session?

HttpSessionBindingListener
Category: JSP Date: 11/7/2010 8:24:58 AM
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