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

What is the difference between Context init parameter and Servlet init parameter?



Posted By: Avi Date: 9 November 2010 10:22:57 AM
 Answer:

Servlet init parameters are declared inside the tag inside Deployment Descriptor and are for a single servlet only. Context init parameters are declared in a tag directly inside the tag. The methods for accessing context init parameter is getServletContext ().getInitParamter (“name”) where as method for accessing servlet init parameter is getServletConfig ().getInitParamter (“name”); Other different: Any servlet or JSP in a web application can access context init parameter. But no body out side that servlet can access Servlet init parameter.


Posted By: avibtech


Date: 9 November 2010 10:22: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 0kFt5y
Related Questions
JSP : How can I enable session tracking for JSP pages if the browser has disabled cookies?

How can I enable session tracking for JSP pages if the browser has disabled cookies?

You can still use session tracking using URL rewriting and it should to append the session ID for ea....
Category: JSP Date: 11/3/2010 8:48:57 PM
JSP : What is deployment descriptor?

What is deployment descriptor?

A deployment descriptor is an XML based file which describes a web application's  deployment se....
Category: JSP Date: 11/3/2010 3:31:59 PM
JSP : What is Server side push?

What is Server side push?

It used to refresh a servlet and that happens when client first connects to Server, then Server keep....
Category: JSP Date: 11/3/2010 2:26:57 PM
JSP : What are the parameters for service method ?

What are the parameters for service method ?

ServletRequest and ServletResponse
Category: JSP Date: 11/3/2010 1:53:57 PM
JSP : What is URL Encoding and URL Decoding ?

What is URL Encoding and URL Decoding ?

URL encoding is the method of replacing all the spaces and other extra characters into their corresp....
Category: JSP Date: 11/3/2010 12:04:58 PM