What is the difference between servlet config and servlet
context.

Answer Posted / khushbu ajmera

A: ServletContext: Defines a set of methods that a servlet
uses to communicate with its servlet container, for example,
to get the MIME type of a file, dispatch requests, or write
to a log file.The ServletContext object is contained within
the ServletConfig object, which the Web server provides the
servlet when the servlet is initialized

ServletConfig: The object created after a servlet is
instantiated and its default constructor is read. It is
created to pass initialization information to the servlet.

Is This Answer Correct ?    13 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a hello world program using servlets.

601


What is the web server used for running the Servlets?

587


How can we upload the file to the server using servlet?

557


Which HTTP method is non-idempotent?

624


Are Servlets Thread Safe? How to achieve thread safety in servlets?

571






How does tomcat servlet container work?

599


What is cgi?

609


What do you mean by request dispatcher in servlet? Also explain its methods.

620


What are the differences between servlet context vs servlet config?

588


Explain the custom jsp tags and the beans.

625


How can the session in servlet can be destroyed?

723


What are the different methods involved in the process of session management in servlets?

675


How is a servlet implemented in code?

574


What is the difference between 2 types of servlets?

655


How can you push data from an Applet to a Servlet?

620