| 
 | Oracle | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||||
@Target(value=java.lang.annotation.ElementType.TYPE) @Retention(value=RUNTIME) public @interface WLServlet
The WLServlet annotation is used to mark a Servlet class with necessary metadata so it can be deployed without being declared in the web.xml descriptor.
Example:
  @WLServlet (
    name = "FOO",
    runAs = "SuperUser"
    initParams = { @WLInitParam (name="one", value="1") }
    mapping = {"/foo/*"}
  )
  public class MyServlet extends HttpServlet { . . . }
 
 Annotating a Servlet class with the above annotation is equivalent to declaring the following in the web.xml descriptor:
  . . .
  <servlet>
     <servlet-name>FOO</servlet-name>
     <servlet-class>MyServlet</servlet-class>
     <init-param>
        <param-name>one</param-name>
        <param-value>1</param-value>
     </init-param>
  </servlet>
  . . .
  <servlet-mapping>
    <servlet-name>FOO</servlet-name>
    <url-pattern>/foo/*</url-pattern>
  </servlet-mapping>
  . . .
 
| Optional Element Summary | |
|---|---|
|  String | descriptionThe description attribute for the Servlet. | 
|  String | displayNameThe display name attribute for the Servlet. | 
|  String | iconThe icon attribute for the Servlet. | 
|  WLInitParam[] | initParamsThe init parameters for the Servlet. | 
|  int | loadOnStartupThe load-on-startup attribute for the Servlet, as defined on the servletelement 
 in the web.xml descriptor. | 
|  String[] | mappingThe url patterns for the Servlet mapping. | 
|  String | nameThe name attribute for the Servlet. | 
|  String | runAsThe 'run-as' attribute for the Servlet, as defined on the servletelement 
 in the web.xml descriptor. | 
public abstract String description
servlet element in the web.xml descriptor.
 Defaults to an empty string.
public abstract String icon
servlet element in the web.xml descriptor.
 Defaults to an empty string.
public abstract String displayName
servlet element in the web.xml descriptor.
 Defaults to an empty string.
public abstract String name
servlet element in the web.xml descriptor. 
 
 If absent, this will default to the class name 
 of the Servlet being annotated.
public abstract WLInitParam[] initParams
servlet element in the web.xml descriptor.
public abstract int loadOnStartup
servlet element 
 in the web.xml descriptor.
 Defaults to -1.
public abstract String runAs
servlet element 
 in the web.xml descriptor.
 Defaults to an empty string.
public abstract String[] mapping
servlet element in the web.xml descriptor.
| 
 | Documentation is available at http://edocs.bea.com/wls/docs103 Copyright 2008 Oracle | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||