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

Why are http servlets used in programming?

723


Which are the different ways you can communicate between servlets?

707


What is servlet and its use?

791


What is a cookie What is the difference between session and cookie

791


Define declaration.

791






What is difference between server and servlet?

769


What is the difference between Difference between doGet() and doPost()?

943


What if you need to span your transaction across multiple servlet invocations?

773


Who is responsible for writing a constructor?

984


What is the use of servletconfig interface?

742


What are the ways to handle multi-threading in servlets?

795


What is api in servlet?

722


What are the annotations used in servlet 3?

744


Tell us something about servletconfig interface.

745


How can you start a jta transaction from a servlet deployed on jboss?

842