div.collapsecontent{display:block;}

Express (Distributed operating systems), v8.0 > Develop and deploying applications > Rapid deployment of J2EE applications > Constructing a J2EE application from artifacts > Dropping J2EE artifacts into a free-form project > Add and deleting Web artifacts from a free-form project


Add and deleting Web filters to a free-form project

We can add or delete Web filter source code, annotated source or compiled class files for various J2EE filter types, such as authentication filters, encryption filters, and data compression filters to or from a free-form project.


Before you begin

Restriction: We can use the rapid deployment tools for packaging applications at J2EE 1.3 or 1.4 specification-levels. However, the rapid deployment tools do not support Java EE 5.0 (or later) nor J2EE 1.2 specification-level. For tools support of deploying Java EE 5 and later modules, you can use the monitored directory starting in WAS V8.0 release. For more details about the monitored directory, see Ways to install enterprise applications or modules and Installing enterprise application files by adding them to a monitored directory topics.

Prerequisites

The filter class must be an implementation of the following type:

javax.servlet.Filter


Procedure

  1. To add Web filters into a free-form project, use your file management system to properly place your filter artifacts into the free-form project. The directory name of the free-form project has the same string value you had provided for the -project parameter used in the wrd-config command.
  2. The following activities occur when you drop a filter into the free-form project:

    1. If necessary, the filter class is generated and mapped to the imported_classes directory of the Web module project. The rapid deployment tools then copy the class files to its appropriate J2EE location which is WebContent/WEB-INF/classes folder of the Web module project. The console output can look like this example when adding a filter Java source file (called MyFilter.java) to a free-form project (called MyProject):
      [07:47:17 PM] [/MyProject/MyFilter.java] Added
      [07:47:20 PM] [/MyProject/bin/MyFilter.class] copied to project [MyProjectWeb]
      [07:47:20 PM] Web Filter added to web.xml MyFilter
      [07:47:20 PM] Filter Mapping added to web.xml /MyFilter
      

      Tip: To monitor the rapid deployment activity, run your rapid deployment session with console output. We can complete this by running the rapid deployment launch tool as follows:

      • wrd.bat -monitor
      • wrd.sh -monitor

    2. A new filter entry along with its display name, and any initialization parameters, URL mappings, and servlet mappings is created in the web deployment descriptor (found in the WebContent\WEB-INF\web.xml file in the Web module project). Example of the entries in web.xml:
      <filter>
      <filter-name>MyFilter
      </filter-name>
      <filter-class>MyFilter
      </filter-class>
      </filter>
      <filter-mapping>
      <filter-name>MyFilter
      </filter-name>
      <url-pattern>MyFilter
      </url-pattern>
      </filter-mapping> 
    3. The application is synchronized with the server.

  3. To delete Web filters from a free-form project, use your file management system to properly remove your filter artifacts from the free-form project. The directory name of the free-form project has the same string value you had provided for the -project parameter used in the wrd-config command.
  4. The following activities occur when you remove a filter from the free-form project:

    1. The console output can look like this example when removing a filter Java source file (called MyFilter.java) from a free-form project (called MyProject):
      [07:56:10 PM] [/MyProject/MyFilter.java] Deleted
      [07:56:10 PM] [/MyProject/bin/MyFilter.class] Deleted
      [07:56:10 PM] Web Filter removed from web.xml MyFilter
      [07:56:10 PM] Filter Mapping removed from web.xml /MyFilter
      
    2. The application is synchronized with the server.


Feedback

+

Search Tips   |   Advanced Search