BBxServlet
Description
In BBj 21.00 and higher, the BBxServlet class provides improved servlet functionality that was previously offered by BBjServlet and BBjspServlet. BBxServlets are designed to offer more intuitive deployment, better usage of licenses, improved error handling, and longevity of support, while providing all of the functionality of previous servlet implementations.
A BBxServlet requires a BBj source file with the following:
-
A public class that defines the servlet
-
A method in that class that returns void and takes a BBxServletContext as its only argument. This method is called the service method.
-
Note that in the examples below, this method is named service, but any valid method name would work.
-
To register a BBxServlet, you must also configure the following:
-
A URL mapping to provide access to the servlet
-
A config file for the servlet to use
-
A status indicating whether the servlet is enabled
See the BBxServlet Tutorial for a guide to the creation, deployment, and usage of BBxServlets.
Creation
BBjAPI > BBjAdmin > BBjJettyServerConfiguration > BBjJettyContextConfiguration > BBxServlet
The BBxServlet object is created through the following BBjJettyContextConfiguration methods:
Return Value | Method |
---|---|
BBxServlet | BBjJettyContextConfiguration::addBBxServlet(String mapping, String source, String classname) |
BBxServlet | BBjJettyContextConfiguration::addBBxServlet(String mapping, String source, String classname, String method) |
BBxServlet | BBjJettyContextConfiguration::addBBxServlet(String mapping, String source, String classname, String method, String config) |
BBxServlet | BBjJettyContextConfiguration::addBBxServlet(String mapping, String source, String classname, String method, int enabled) |
BBxServlet | BBjJettyContextConfiguration::addBBxServlet(String mapping, String source, String classname, String method, String config, int enabled) |
BBxServlet |
BBjJettyContextConfiguration::addBBxServlet(String classname, String mapping, String source) (Alternate argument order for compatibility with BBjspServlets) |
BBxServlet |
BBjJettyContextConfiguration::addBBxServlet(String classname, String mapping, String source, String config) (Alternate argument order for compatibility with BBjspServlets) |
Methods of BBxServlet
Return Value | Method |
---|---|
void |
addParam(String name, String value) (Deprecated method to facilitate migration from BBjspServlet) |
void | addParameter(String name, String value) |
void | clearParameters() |
void |
(Deprecated method to facilitate migration from BBjspServlet) |
void | disable() |
void | enable() |
String | getClassName() |
String | getClassPath() |
String |
(Deprecated method to facilitate migration from BBjspServlet) |
String | getConfigFile() |
String | getMapping() |
String | getMethod() |
String | getParameter(String name) |
BBjVector | getParameterNames() |
String | getSourceFile() |
String |
(Deprecated method to facilitate migration from BBjspServlet) |
String | getTerminalAlias() |
String | getUser() |
String | getWorkingDir() |
boolean | isEnabled() |
void | setClassName(String className) |
void | setClassPath(String sscp) |
void |
setConfig(String config) (Deprecated method to facilitate migration from BBjspServlet) |
void | setConfigFile(String config) |
void |
setEnabled(boolean enabled) (Deprecated method to facilitate migration from BBjspServlet) |
void | setMethod(String method) |
void | setSourceFile(String source) |
void | setTerminalAlias(String alias) |
void | setUser(String user) |
void | setWorkingDir(String dir) |
Examples
|
|
See Also
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.