when the webcontainer creates ServeletConfig,ServletContext
objects? befoure creating the Servlet object or not?
Answers were Sorted based on User's Feedback
Answer / d.murali krishna
when ever a web application (.war file)is deployed in to
running server, immediatly the server reads corresponding
configuration file.
if parsing of that web.xml is succeded, then only
ServeletContext instance is created, other wise
ServletContext instance creation is failed. Then that web
application is not ready to provide services.
When ever a request is given to Servlet first time, first
Servlet instance is created, then its ServletConfig
instance is created.
| Is This Answer Correct ? | 15 Yes | 5 No |
Answer / durga ganesh reddy
Just by receiving a request, the web container creates
ServletContext object(so it is called asapplication
object).After creating servlet object then ServletConfig
object will be created.For each servlet instance there will
be a ServletConfig istance is available separtely.
| Is This Answer Correct ? | 11 Yes | 8 No |
Answer / pavankumar
when we deploy the web application.the server reads the contents from configuration file(web.xml file) and server checks whether corresponding servlet object is created or not if it is created the server does'nt creates if it is not there then it create
before that when we deploy the web application ServletContext is created.
After the creation of servlet object .then servletConfig is created for that corresponding servlet.
| Is This Answer Correct ? | 1 Yes | 3 No |
Answer / ravikiran.chd
the servlet context & servlet config objects will be created
once the application is deployed into the container,
| Is This Answer Correct ? | 1 Yes | 5 No |
Why is it that we can't give relative URL's when using ServletContext.getRequestDispatcher() when we can use the same while calling ServletRequest.getRequestDispatcher()?
How the JSP file will be executed on the Server side?
Why is a constructor needed in a servlet even if we use the init method?
how the server will know its the same jsp page?
what are the disadvantages of cookies?
How forward () method is different from send redirect () method?
What is meant by session? Tell me something about httpsession class?
What is with the javax.servlet package naming?
What happens, when client requests for server object, which is not yet loaded into the memory?
Describe some assignments that are executed by servlet container?
Which are the different ways you can communicate between servlets?
How do you deal property files in servlet?