emilly
emilly

Reputation: 10530

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?

Upvotes: 3

Views: 1672

Answers (1)

axtavt
axtavt

Reputation: 242706

By default - no.

You can enable execution of specific filter on forward by adding

<dispatcher>FORWARD</dispatcher>

to its <filter-mapping>.

Upvotes: 4

Related Questions