BBjJettyContextConfiguration::addJavaServlet


Description

In BBj 15.0 and higher, this method is used to configure a new Java Servlet within the current Context.

Syntax

Return Value

Method

BBjJavaServletConfiguration

addJavaServlet(string name, string mapping)

Parameters

Variable

Description

mapping

the URL mapping

name

the name of the servlet

Return Value

a new BBjJavaServletConfiguration object

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()
declare BBjJavaServletConfiguration servlet!
servlet! = root!.addJavaServlet("com.wibble.SomeServlet","/*")
print servlet!
servlet!.setParameter("DATABASE","MyDatabase")
config!.saveConfig()

See Also

BBjAPI

BBjJettyContextConfiguration

BBjJavaServletConfiguration