2010/01/11 - Apache Beehive has been retired.

For more information, please explore the Attic.

Apache > Beehive
 

Servlet Container Adapters

Writing a Servlet Container Adapter

Certain NetUI features (like the default behavior for FlowController.login()) depend on container-specific capabilities. NetUI uses "servlet container adapters" to take advantage of container-specific functionality.

To write an adapter:

  1. Write a class that implements org.apache.beehive.netui.pageflow.ServletContainerAdapter. You can extend org.apache.beehive.netui.pageflow.DefaultServletContainerAdapter.
  2. Package the class in a JAR file which also contains a text file in directory META-INF/services called org.apache.beehive.netui.pageflow.ServletContainerAdapter. The text file should have a single line that is the full class name of your ServletContainerAdapter
  3. Drop the JAR into the WEB-INF/lib directory of your web application. The NetUI runtime will automatically pick up the first "discovered" adapter that answers true when its accept method is called.
Note
Note: the default ServletContainerAdapter defines "production mode" as the state where assertions are disabled. (See Development and Production Modes for details.) Even if you do not want to use existing adapters for container-specific features, you may want to write your own adapter that defines production mode (ServletContainerAdapter.isInProductionMode()) according to your own requirements.