BBjServletEvent

Description

In BBj 12.0 and higher, the BBjServletEvent provides access to the BBjHttpRequest. The request and response objects allow complete control of HTTP interaction. This event is returned by BBjAPI().getLastEvent() when the program is executing callback code that the program has registered for the ON_WEB_CONNECTION event. 

Creation

No create methods were specified for this object.

Methods of BBjServletEvent

Return Value

Method

BBjHttpRequest

getHttpRequest()

BBjHttpResponse

getHttpResponse()

Remarks

BBjServletEvents are generated by the web server and delivered to your application in response to specific web requests .

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

BBjServletData

CALLBACK Verb - Register BBj Subroutine