BBjJettyContextConfiguration

Description

In BBj 15.0 and higher, this class allows the configuration of web contexts within the Jetty Server. This class is used to programmatically configure these contexts.

Each context can contain a unique set of BBxServlets, BUI applications, JNLP application and static content.

To access the main BBj context, which is the default context for all applications, use the BBjJettyServerConfiguration::getRootContextInfo() method.

The context path is the prefix of a URL path that is used to select the context to which an incoming request is passed.

Typically a URL in a BBxServlet is in the format http://hostname:8888/contextPath/servlet/servletPath, where each of the path elements can be zero or more / separated elements. If there is no context path, the context is referred to as the root context. The root context must be configured as '/'.

Creation

BBjAPI > BBjAdmin > BBjJettyServerConfiguration > BBjJettyContextConfiguration

The BBjJettyContextConfiguration is created through the following BBjJettyServerConfiguration methods:

Return Value

Method

BBjJettyContextConfiguration

createCustomContext(string name)

BBjJettyContextConfiguration

getCustomContext(string name)

BBjJettyContextConfiguration

getRootContextInfo()

Methods of BBjJettyContextConfiguration

Return Value

Method

BBjServletConfiguration

addBBjServlet(string name, string program, string config)

BBjspServletConfiguration

addBBjspServlet(string classname, string mapping, string source)

BBjspServletConfiguration

addBBjspServlet(string classname, string mapping, string source, string config)

BBxServlet

addBBxServlet(String mapping, String source, String classname)

addBBxServlet(String mapping, String source, String classname, String method)

addBBxServlet(String mapping, String source, String classname, String method, String config)

addBBxServlet(String mapping, String source, String classname, String method, int enabled)

addBBxServlet(String mapping, String source, String classname, String method, String config, int enabled)

addBBxServlet(String classname, String mapping, String source)

addBBxServlet(String classname, String mapping, String source, String config)

BBjspCommandConfig

addCommandConfig(string path, string className, string source)

void

addHost(string hostname)

BBjJavaServletConfiguration

addJavaServlet(string name, string mapping)

BBjspPipelineConfig

addPipelineConfig(string name)

void

addWelcomeFile(string welcome)

boolean

canDelete()

BBjspCommandConfig

deleteCommandConfig(string name)

void

deleteHeader(string name)

void

deleteParameter(string name)

void

disable()

void

enable()

BBjspServletConfiguration

getBBjspServlet(string mapping)

BBjVector

getBBjspServletMappings()

BBjVector

getBBjspServlets()

BBxServlet getBBxServlet(String mapping)
BBjVector getBBxServletMappings()
BBjVector getBBxServlets()

string

getClasspath()

BBjspCommandConfig

getCommandConfig(string name)

BBjVector

getCommandConfigs()

string

getCommandExtensions()

string

getConfig()

string

getContextStartProgram()

string

getContextStopProgram()

string

getDevMode()

string

getDocBase()

string

getEncoding()

string

getHeader(string name)

BBjVector

getHeaderNames()

BBjVector

getHosts()

int

getHttpPort()

BBjJavaServletConfiguration

getJavaServlet(string name, string mapping)

BBjVector

getJavaServlets()

string

getPageExtensions()

BBjVector

getParameterNames()

string

getParameterValue(string name)

string

getPath()

BBjspPipelineConfig

getPipelineConfig(string name)

BBjVector

getPipelineConfigs()

BBjServletConfiguration

getServlet(string name)

BBjVector

getServletNames()

BBjVector

getServlets()

string

getSessionStartProgram()

string

getSessionStopProgram()

int getSSLPort()

string

getStatus()

string

getWarFile()

BBjVector

getWelcomeFiles()

boolean

isEnabled()

boolean

isHTTP()

boolean

isSessionCookieHttpOnly()

boolean

isSessionCookieSecure()

void

putCommandConfig(BBjspCommandConfig config)

void

removeBBjServlet(string name)

void

removeBBjspServlet(string mapping)

void removeBBxServlet(String mapping)

void

removeHost(string host)

void

removeJavaServlet(BBjJavaServletConfiguration servlet)

void

removeWelcomeFile(string welcome)

void

saveCommandConfigs()

void

setClasspath(string classpath)

void

setCommandExtensions(string extension)

void

setConfig(string config)

void

setContextStartProgram(string program)

void

setContextStopProgram(string program)

void

setDevMode(string devmode)

void

setDocBase(string docBase)

void

setEncoding(string encoding)

void

setHeader(string name, string value)

void

setHTTP(boolean http)

void

setHttpPort(int port)

void

setPageExtensions(string extension)

void

setParameter(string name, string value)

void

setPath(string path)

void

setSessionCookieHttpOnly(boolean httpOnly)

void

setSessionCookieSecure(boolean secure)

void

setSessionStartProgram(string program)

void

setSessionStopProgram(string program)

void setSSLPort(int port)

void

setStatus(string status)

void

setWarFile(string warFile)

Constants

Example

Copy

BBjJettyContextConfiguration 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 -- Print the Servlets Registered
vect_servlets! = root!.getServlets()
sz = vect_servlets!.size()
if sz then
  for i = 0 to sz-1
    declare ServletConfiguration servletConfig!
    servletConfig! = cast(ServletConfiguration,vect_servlets!.get(i))
    name$ = str(servletConfig!.getName())
    prog$ = str(servletConfig!.getProgram())
    config$ = str(servletConfig!.getConfig())
    print "SERVLET NAME:'" + name$ + "' PROGRAM:'" + prog$ + "' CONFIG:'" + config$ + "'"
  next i
endif

ClosedVersion History

  • BBj 21.0: Added BBxServlet methods.

  • BBj 16.0: Added methods covering BBJSP specific configurations.

  • BBj 15.0: BBjJettyContextConfiguration introduced.

See Also

BBjAPI

BBjJettyServerConfiguration

BBjServletConfiguration

BBjJettyServerConfiguration

BBjJavaServletConfiguration