Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
HydraExpress Servlet Development Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

6.5 Defining Filters, Servlets, and Listeners

Each filter, servlet, or listener implementation must contain a macro that defines the class for the servlet container. The macro definition expands to a function. The servlet container uses this function to load an instance of the class.

The name of each macro starts with RWSF_DEFINE. HydraExpress includes two macros for each type of object, as shown in Table 2:

Table 2: Macros for defining filters, servlets, and listeners 

MacroExpands to Function Name

RWSF_DEFINE_SERVLET(ServletClass)

createServletClass

RWSF_DEFINE_SERVLET_NAME(ServletClass,

functionName)

functionName

RWSF_DEFINE_LISTENER(ListenerClass)

createListenerClass

RWSF_DEFINE_LISTENER_NAME(ListenerClass,

functionName)

functionName

RWSF_DEFINE_FILTER(FilterClass)

createFilterClass

RWSF_DEFINE_FILTER_NAME(FilterClass,

functionName)

functionName

When the filter, servlet, or listener is defined within a context, the class declaration for the object must contain the generated function name. For example, the macro RWSF_DEFINE_SERVLET(MyServlet) expands to the function createMyServlet. To load the servlet, the class declaration must contain the function name createMyServlet. See Chapter 4 for information on adding filters, listeners, and servlets to the servlet container.



Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved. All Rights Reserved. Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. HydraExpress is a trademark of Rogue Wave Software, Inc. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.