PERGUNTA FACIL - em que momento é inicializado um ServletContext?

2 respostas
V

O servlet context é inicializado quando qq Servlet for acessado?

Se inserir no web.xml load-on-startup para inicializar o servlet, automaticamente sao criados os objetos implicitos ServletContext, Session etc???

SE ALGUM PUDER AJUDAR. OBRIGADO!!!

2 Respostas

M

o ServletContext é iniciado quando o servidor Java é inicializado.

Quando vc chamar um Servlet o ServletContext já está criado.

MarcioTavares

Não sei se isso vai te ajudar, deve ser detalhe demais, mas dá uma olhada:

http://tomcat.apache.org/tomcat-5.5-doc/architecture/startup.html

http://tomcat.apache.org/tomcat-5.5-doc/architecture/startup/serverStartup.txt

<blockquote>…

The deployer will create a Digester for your context, this digester

will then invoke ContextConfig.start()

The ContextConfig.start() will process the default web.xml (conf/web.xml)

and then process the applications web.xml (WEB-INF/web.xml)

…</blockquote>
Criado 11 de fevereiro de 2007
Ultima resposta 12 de fev. de 2007
Respostas 2
Participantes 3