You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Larry Isaacs <La...@sas.com> on 2000/09/12 18:52:32 UTC

Where should LoadOnStartupInterceptor go in server.xml

Hi,

Yoshiyuki Karezaki's patch for Bug 103 reveals that LoadOnStartupInterceptor is making a "cm.service( request, response )" call in loadJsp() before any RequestInterceptors are initialized.  Removing the request.getSession(true) call avoids an error hitting the StandardSessionInterceptor before it is ready, but should the LoadOnStartupInterceptor be moved to be last to allow all other interceptors to initialize first?  Would this the correct thing to do or would there be other side effects?

Larry

__________
Larry Isaacs		
Larry.Isaacs@sas.com
SAS Institute Inc.


Re: Where should LoadOnStartupInterceptor go in server.xml

Posted by cm...@yahoo.com.
LoadOnStartup must be called after everything is set up - so probably
making it LAST ( or AT_END ) is a good idea.

A good ( global ) solution is to finally implement the hook chains as in
Apache or NES - instead of using the order of interceptors from the config
file for all hook chains ( or "chains of responsibility" ), we can either
use Apache or NES style.

Apache: individual interceptor[] for each callback, init() method in
interceptor will call addHook() for all chains the interceptor is
interested in. We'll pass a parameter ( FIRST, BEGIN, MIDDLE, END, LAST
plus BEFORE and AFTER) to specify where to insert the interceptor.

NES: for each chain we explicitely define the order of calling the
interceptors. Each interceptor will have an id, and we add at config
time a new tag:
<HOOK name="requestMap" order="...."/>


( that will also solve the non-problem of empty method calls :-)

Larry - let's first try the simple solution ( moving LoadOnStartup at
end) - but for 3.3 it's a good idea to start thinking about this. 


Costin

> Yoshiyuki Karezaki's patch for Bug 103 reveals that LoadOnStartupInterceptor is making a "cm.service( request, response )" call in loadJsp() before any RequestInterceptors are initialized.  Removing the request.getSession(true) call avoids an error hitting the StandardSessionInterceptor before it is ready, but should the LoadOnStartupInterceptor be moved to be last to allow all other interceptors to initialize first?  Would this the correct thing to do or would there be other side effects?