Oracle Fusion Middleware
Oracle WebLogic Server API Reference
11g Release 1 (10.3.3)

Part Number E13941-03

weblogic.servlet.annotation
Annotation Type WLFilter


@Target(value=java.lang.annotation.ElementType.TYPE)
@Retention(value=RUNTIME)
public @interface WLFilter

The WLFilter annotation is used to mark a Filter class with necessary metadata so it can be deployed without being declared in the web.xml descriptor.

Example:

  @WLFilter (
    name = "BAR",
    initParams = { @WLInitParam (name="one", value="1") }
    mapping = {"/bar/*"}
  )
  public class MyFilter implements Filter { . . . }
 

Annotating a Filter class with the above annotation is equivalent to declaring the following in the web.xml descriptor:

  . . .
  <filter>
    <filter-name>BAR</filter-name>
    <filter-class>MyFilter</filter-class>
    <init-param>
       <param-name>one</param-name>
       <param-value>1</param-value>
    </init-param>
  </filter>
  . . .
  <filter-mapping>
    <filter-name>BAR</filter-name>
    <url-pattern>/bar/*</url-pattern>
  </filter-mapping>
  . . .
 


Optional Element Summary
 String description
          The description attribute for the Filter.
 String displayName
          The display name attribute for the Filter.
 String icon
          The icon attribute for the Filter.
 WLInitParam[] initParams
          The init parameters for the Filter.
 String[] mapping
          The url patterns for the Filter mapping.
 String name
          The name attribute for the Filter.
 

description

public abstract String description
The description attribute for the Filter. This corresponds to the 'description' attribute on the filter element in the web.xml descriptor. Defaults to an empty string.

Default:
""

icon

public abstract String icon
The icon attribute for the Filter. This corresponds to the 'icon' attribute on the filter element in the web.xml descriptor. Defaults to empty string

Default:
""

displayName

public abstract String displayName
The display name attribute for the Filter. This corresponds to the 'display-name' attribute on the filter element in the web.xml descriptor. Defaults to an empty string.

Default:
""

name

public abstract String name
The name attribute for the Filter. This corresponds to the 'name' attribute on the filter element in the web.xml descriptor. If absent, this will default to the class name of the Filter being annotated.

Default:
""

initParams

public abstract WLInitParam[] initParams
The init parameters for the Filter. This corresponds to the 'init-param' attribute on the filter element in the web.xml descriptor.

Default:
{}

mapping

public abstract String[] mapping
The url patterns for the Filter mapping. This corresponds to the 'filter-mapping' attribute on the filter element in the web.xml descriptor.

Default:
{}

Copyright 1996, 2010, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Oracle Fusion Middleware
Oracle WebLogic Server 10.3.3 API Reference
11g Release 1 (10.3.3)

Part Number E13941-03