What is the use of web.xml and why do we use?
<filter>
<filter-name>wicket.mysticpaste</filter-name>
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
<init-param>
<param-name>applicationClassName</param-name>
<param-value>com.mysticcoders.WicketApplication</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>wicket.mysticpaste</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
What does this filer and filermapping do?
Generally speaking, this is the configuration file of web applications in java. It instructs the servlet container (tomcat for ex.) which classes to load, what parameters to set in the context, and how to intercept requests coming from browsers.
There you specify:
In servlet 3.0 many of the web.xml parts are optional. These configurations can be done via annotations (@WebServlet
, @WebListener
)