Each filter, servlet, or listener implementation must contain a macro that expands to a create function. The Agent 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:
Of the two versions of each servlet, listener, and filter macro in Table 2, the first listed uses the default function name "create<typeofClass>". For example, the macro RWSF_DEFINE_SERVLET(MyServlet) expands to the function createMyServlet in the class, MyServlet. The Agent uses the function to construct an instance of the servlet.
RWSF_DEFINE_SERVLET(MyServlet) |
This is referenced in the servlet configuration file web.xml:
<servlet> <servlet-name>MyServlet</servlet-name> <servlet-class>MyServlet_library.createMyServlet</servlet-class> </servlet> |
The second macro, RWSF_DEFINE_SERVLET_NAME(ServletClass, functionName) allows you to create a custom function name that is more relevant to your own applications, such as:
RWSF_DEFINE_SERVLET_NAME(MyServletClass, generateServlet) |
In this example, the function name will be generateServlet instead of createServletClass, and web.xml will define the servlet like this:
<servlet> <servlet-name>MyServlet</servlet-name> <servlet-class>MyServlet_library.generateServlet</servlet-class> </servlet> |
Note the servlet configuration above indicates that class MyServlet has been built into the shared library, MyServlet_library.
See Chapter 4 for information on adding filters, listeners, and servlets to the servlet container.
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.