Q:

Why does wicket use Filter in Web.xml instead of Servlet?

Wondering why wicket uses filter in Web.xml instead of Servlet. Every request has to go through filter and will it not affect the performance?

A:

Every request goes through all filters (which match their mappings) before being passed to the servlets, so WicketFilter would be consulted before any Servlet!
With Filter the application has more flexibility to decide what to be served by the filter itself and what to pass to any following filters and/or servlets. E.g. with WicketFilter's "ignorePaths" parameter the application can decide to pass-through any kind of requests to other frameworks and/or the web container.

