Here's how it looks under web.xml :
<servlet> <servlet-name>ServletConfigDemo</servlet-name> <servlet-class>com.javarace.ServletConfigTest</servlet-class> <init-param> <param-name>topic</param-name> <param-value>Difference between ServletConfig and ServletContext</param-value> </init-param> </servlet>
Here's how it looks under web.xml :
<context-param> <param-name>globalVariable</param-name> <param-value>com.javarace</param-value> </context-param>
So finally...
No. of web applications = That many number of ServletContext objects
No. of servlet classes = That many number of ServletConfig objects
Difference between ServletContext and ServletConfig
Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.
We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc