On 9/7/17, 3:06 PM, "Christopher Schultz" <ch...@christopherschultz.net> wrote:

    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?

I’m not sure I follow. I can’t modify source code of the first servlet.
    > 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?

I know the name of the servlet. If I had a request I could use 
RequestDispatcher.include. But, I need to do this hopefully before any request 
is received.


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

Reply via email to