![]()
|
Web Server PluginTry It Out
What It DoesThe WebServerPlugin provides a simple web server that can be set up from configuration files. It is set up to serve the WBI documentation by default. You can change this by modifying the server configuration file. Note that the server can serve files from the file system and it can process CGIs. In addition, it can be addressed as a proxy (when WBI is set to be your browser's proxy) and it can also be addressed simply as a server (i.e., you can treat it like any web server and obtain files by typing in URLs). Setting up the serverSee the file etc/plugins/ibm/webserver/home.prop for sample set up file. For each server root/file system root pair, simply add another line to the file that contains settings. The configuration file format is as follows:
ProxyServerName = _wbi Note that the "ProxyServerName" can be left out, and this web server will only respond to direct requests (not proxy requests). Note also that you can specify cgi's by adding a ",true" of the end of the line. Thus, in this case you can get files from the server (if it is running on localhost on port 8088) by asking for:
http://localhost:8088/files/foo.html and you can get the "doit" script executed by asking for:
http://localhost:8088/doit and with the "doit" case, you can also pass query args in the URL, such as:
http://localhost:8088/doit?foo=foo&bar=bar+bazOr if you're set up to use WBI as a proxy, then you can also ask for:
http://_wbi/files/foo.html How It WorksThe WebServerPlugin is rather straightforward. It simply sets up a file generator and a cgi generator based on settings found in the configuration file. More precisely, the plugin's initialize method loops through lines in the cofiguration file, instantiating and setting the rule condition for either a ServerFileGenerator or a CgiGenerator based on the settings contained in the line. The CgiGenerator is a simply a bean in the beans package. The ServerFileGenerator simply wrappers a bean. Known Problems
Some key WBI classes that were used:
The Source
|