Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The main advantage of working with a filter instead of a servlet is that it is easier to pass through resources, and map your application to the root.

Here's an example of how to configure your application now with a filter in web.xml:

Code Block
xml
xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
      "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
  <filter>
    <filter-name>MyApplication</filter-name>
    <filter-class>wicket.protocol.http.WicketFilter</filter-class>
    <init-param>
      <param-name>applicationClassName</param-name>
      <param-value>com.myapp.MyApplication</param-value>
    </init-param>
    <init-param>
      <param-name>filterPath</param-name>
      <param-value>app</param-value>
    </init-param>
  </filter>

  <filter-mapping>
    <filter-name>MyApplication</filter-name>
    <url-pattern>/app/*</url-pattern>
  </filter-mapping>
</web-app>

Wicket-Spring

@SpringBean.name has been deprecated and replaced with @SpringBean.id which aligns much better with spring.

...