BBjServletData (Deprecated)

BBjServlets are deprecated for BBj 21.00 and higher, and have been replaced by BBxServlets.

Description

In BBj 12.00 and higher, the BBjServletData object allows your program to register callbacks for incoming web requests.

When the webserver first receives a request registered with the BBjServletRegistry, an interpreter will be started with the registered BBjAppConfig. That application then registers handlers for callback events. BBjServletData provides a handle to the internal configuration for registering callbacks.

Creation

BBjAPI > BBjServletData

The BBjServletData object is obtained through the following BBjAPI method:

Return Value

Method

BBjServletData

getServletData()

Methods of BBjServletData

Return Value

Method

void

clearCallback(int eventType)

void

setCallback(int eventType, CustomObject customObj, string methodName)

void

setCallback(int eventType, string subroutineName)

Remarks

None.

Constants

311

ON_WEB_CONNECTION

Example

MyServlet! = new MyServlet()
data! = BBjAPI().getServletData()
data!.setCallback(data!.ON_WEB_CONNECTION, myServlet!, "myMethod")
process_events
class public MyServlet
    method public void myMethod(BBjServletEvent p_event!)
        let chan = UNT
        open (chan)"JSERVLET"
        print (chan)"<html><body>"
        print (chan)"Hello BBj World!"
        print (chan)"</body></html>"
        close (chan)
    methodend
classend

See Also

BBjAPI

BBjServletRegistry

BBjServletEvent

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.