BBjServletConfiguration (Deprecated)

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

Description

In BBj 15.00 and higher, BBj Servlets can be programmatically configured though the AdminAPI.

This class is used to configure a BBjServlet that will be automatically deployed within a BBjJettyContextConfiguration. The configuration comprises 3 elements

  • NAME - will form part of the URL

  • PROGRAM - the source file containing the servlet code

  • CONFIG - the BBj configuration file to use during execution

Creation

BBjAPIBBjAdminBBjJettyServerConfiguration > BBjJettyContextConfiguration > BBjServletConfiguration

The BBjServletConfiguration is created through the following BBjJettyContextConfiguration methods:

Return Value

Method

BBjServletConfiguration

addBBjServlet(string name, string program, string config)

BBjServletConfiguration

getServlet(string name)

Methods of BBjServletConfiguration

Return Value

Method

string

getConfig()

string

getName()

string

getProgram()

void

setConfig(string config)

void

setProgram(string program)

Remarks

None.

Example

declare BBjAPI api!
declare BBjAdmin admin!
declare BBjJettyServerConfiguration config!
declare BBjJettyContextConfiguration root!
api! = BBJAPI()
admin! = api!.getAdmin("admin","admin123")
config! = admin!.getJettyServerConfig()
root! = config!.getRootContextInfo()

rem '-- Get ALL the servlets from the root context and print their configuration
vect_servlets! = root!.getServlets()
sz = vect_servlets!.size()
if (sz) then
    for i = 0 to sz-1
        declare BBjServletConfiguration servletConfig!
        servletConfig! = cast(BBjServletConfiguration,vect_servlets!.get(i))
        print "SERVLET NAME:" + str(servletConfig!.getName())
        print "SERVLET PROGRAM:" + str(servletConfig!.getProgram())
        print "SERVLET CONFIG:" + str(servletConfig!.getConfig())
    next i
endif

See Also