On 23/03/2020 14:23, Jonathan Yom-Tov wrote:
> What about valves which are added programmatically within the same engine?
> Is it possible to control the order?

Not directly. Valves added programmatically are added to the end of the
Pipeline. There isn't an insertValve() method so you need to add them in
the order you want them to be used.

> On Mon, Mar 23, 2020 at 4:14 PM Christopher Schultz <
> ch...@christopherschultz.net> wrote:
>
> Mark,
> 
> On 3/23/20 09:59, Mark Thomas wrote:
>>>> On 23/03/2020 13:13, Jonathan Yom-Tov wrote:
>>>>> I'm trying to create a valve which will prevent another valve
>>>>> from working in case a particular request is made. Is there a way
>>>>> to control the valve execution order so that I can inject my
>>>>> valve right before the valve I want to stop?
>>>>
>>>> Valves should be added (and hence executed) in the order they
>>>> appear in the XML.
>>>>
>>>> Also, Valves on an Engine always execute before those on a Host
>>>> which always execute before those on a Context.
> 
> Correct me if I'm wrong, but there is one more caveat: if the
> <Context> defines its own Authenticator, then whatever Authenticator
> Tomcat would have also automatically added is in fact NOT added.
> 
> Where does the context's authentication valve go in that situation? In
> the position where the default one would have gone, or in the
> <Context>'s position according to the XML?

As per the order of Valves nested in the Context element.

Mark

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

Reply via email to