File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServletConfig vs ServletContext

 
Smitha Amresh
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,

What is the differance between ServletConfig and Servlet Context?
Which is same for all servlets(for the application.

Thanks in Advance.

Regards
Smitha Amresh Parika
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question has been asked a few times here. Use the search tool with ServletConfig and ServletContext as keywords and you should be able to find
those conversations.

In the mean time, the best source of information for a question like this is the API documentation:
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletConfig.html
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletContext.html
 
Sharad Agarwal
Ranch Hand
Posts: 167
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Smitha Amresh:
Which is same for all servlets(for the application.


ServletContext
 
Rakesh Jhamb
Ranch Hand
Posts: 154
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Servlet Config as the name suggests, provides Servlet specific configuration information to a particular servlet. For Example :- the information that u specify in the web.xml file like this

<servlet>
<init-param>...

</init-param>
</servlet>

Each servlet will have its own servlet config object, which will be specific to that servlet.

ServletContext
--------------
It provides application view to all the servlets. There is one ServletContext per JVM for one application.
It also provides methods to access application wide parameters specified
in <context-param>....</context-param> tag in web.xml.

These will be accessible to all the servlets.

I hope it works for you...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic