jump to navigation

ServletConfig vs ServletContext August 23, 2005

Posted by Coolguy in Servlets/Jsp.

ServletConfig :

  • One ServletConfig per servlet
  • Used to pass deploy-time info to servlet and configured in deployment descriptor
  • Used to access ServletContext
  • Within servlet element in DD:

    <description>test parameter</description>

  • getServletConfig.getInitParameter(“myname”);
  • Available to only to the servlet which has init-param configured


  • One per webapp
  • If webapp is distributed, one per JVM
  • Used to access webapp parameters configured in deployment descriptor
  • Application bulletin-board
  • Use to get server info
  • Within web-app element of DD
  • <context-param>

  • Avilable to any servlet or JSP that are part of webapp


No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: