BBJSP Servlet (Deprecated)

The BBJSP system is deprecated. For new development, use BBxServlet.

Description

In BBj 16.0 and higher, the BBJSP framework provides a new Servlet engine which allows you to take complete control of the processing of the request with close compatibility to other components on the BBJSP framework.

The sample below shows a basic BBJSP servlet which is implemented as a custom class and implements following method:

Methods of Servlet

Return Value

Method

void

service(BBjspServletContextcontext)

Remarks

This is a simple servlet that returns simple HTML content.

Example

CLASS PUBLIC MyServlet

    rem '===
    rem '=== You must implement this method as it is the main execution point.
    rem '===
    METHOD PUBLIC void service(BBjspServletContext context!)
        declare BBjspWebRequest request!
        declare BBjspWebResponse response!
        declare BBjspSessionData data!

        request! = context!.getRequest()
        response! = context!.getResponse()
        data! = context!.getBBjspSession()

        s! = response!.getOutputStream()
        s!.write("<html>")
        s!.write("<body>")
        s!.write("<h1>OK</h1>")
        s!.write("</body>")
        s!.write("</html>")

    METHODEND

CLASSEND

See Also

BBJSP

BBJSP Servlet Overview