-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Kendall,

On 9/7/17 5:36 PM, Kendall Shaw wrote:
> A web application that is not mine needs to be initialized after
> it starts before some resources are available. Manually, I would
> start tomcat (9.0.0.M9 on redhat linux) then request 
> http://example.com:8080/start-up.
> 
> The web application has a servlet configured with 
> <load-on-startup>1</load-on-startup>.
> 
> I am attempting to do the initialization by creating a servlet
> that is configured with <load-on-startup>2</load-on-startup>. But,
> I have not figured out how to use the 1st servlet from the 2nd.
> 
> The second servlet only implements the init method. It is never
> going to receive a request. Its only purpose is to invoke the
> first servlet.

Why not implement a proper lazy-initialization scheme, and not bother
with servlet #2?

> How can I find the path of the other servlet and send it a
> request, without having first received a request? I can’t use a 
> ServletRequestListener, because I want the initialization to occur 
> before the first servlet receives its first request.

How would you know the path of the other servlet at all? What
information do you think you need, and why don't you think you have
that information available to the init() method?

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJZscLMAAoJEBzwKT+lPKRYTCsQAL/N1PShOrW9MtwqOjlReMss
Wbmq/kSBT4PM6ea5UtrMVsXzU+ExU673TL5ZYuhV1MVWBjfAZv4xh9xwAOE0rw0D
wGEoL4exg81mLxmcVWUQbFKDyNF1tGGTHR/uKUXneKygHq4LfabKrIIBPcnmI8OX
GkQ7bQlZwLCchM8Mjo9ibHtRVqqV7OzsaE1X7rlPDztiPGp33OGvGE6L9sXTeBq/
cTYbNZ60GK6tKSYnFFYUFs5Av/XymVJFImLsOzOfN+oslZk13JdFZuGbS/sZqZ2V
Th4NNQxJbYSfjwwLJXqc3KBBLUYY63aEaKhHd8wgUE4PY90XvgehVn7+ZzgH5N9J
0vZ2ExBGXOnn1DIIgCY9A89Yz8WTrQ0NYkceVMgQSfGP7SCGT88u5QmQlKwHAQ3u
zgeI/3A0B+qmkpN//U+nRzDRWlQvObsMEts7vqOF7OndaxAomiKvSOFJm5iSirWb
45drAuq7sEGYcdTAWkRtWyaeWK5con20H4gwPK5NWT1fnVEja8j/F3pxrl2/20UU
6SNbs3bDC+2llwi9KUzNcLdn9G/STZmtbbHSmUVCOCk1rS/rJdroYS1aEyJJHW6y
RMiVHWu1IAqLelIvBwbTmfHrUBg6W3sYpDKvNdbim8X4WEp2UMRIqVW+RMnZMIS9
rC6zkIwxK6yMjM5GQzYL
=KrQ2
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to