Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does filter in web.xml gets executed when we forward the request?

When i forward the request from servlet to another, does filters described in web.xml get executed? In fact i am not sure whether web.xm comes in to picture or not in case of request forward? I know it happens in case of redirect as its fresh request from browser but not sure about forward?

like image 637
emilly Avatar asked May 15 '26 19:05

emilly


1 Answers

By default - no.

You can enable execution of specific filter on forward by adding

<dispatcher>FORWARD</dispatcher>

to its <filter-mapping>.

like image 161
axtavt Avatar answered May 18 '26 09:05

axtavt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!