concept filter in category seam

appears as: filter, Filters, filter, filters, The filter
Seam in Action

This is an excerpt from Manning's book Seam in Action.

Code generation customization is useful when you find yourself having to reverse-engineer a much larger, perhaps more loosely defined database than the one prepared for the Open 18 prototype application. Faced with this task, you may need to use only portions of the schema or simply exclude temporary tables. The reverse-engineering tool offers the <table-filter> element to satisfy this requirement. The <table-filter> accepts a schema name and a table name, which it uses in a LIKE clause to locate tables in the database. You can use the string .* in the name, which is replaced with % when the lookup is executed to allow for a fuzzy search. If you set the exclude attribute on <table-filter> to false, then the filter works by including tables from an empty set. Otherwise, the table filter excludes tables from the full set of tables.

Servlet filters wrap around the entire request, executing logic before and after the servlet handling the request. Seam uses a single filter to wrap the JSF servlet in order to trap scenarios that fall outside of the JSF life cycle—or that JSF fails to capture. But Seam’s filter isn’t limited to JSF requests. It canvases all requests, allowing non-JSF requests to access the Seam container as well. Seam can function without relying on filters, but the services it adds are worth the small effort of getting them installed.

  <filter>
    <filter-name>Seam Filter</filter-name>
    <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>Seam Filter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>