root/sandbox/minibase/trunk/demo/app.js
| Revision 8916, 1.0 kB (checked in by hannes, 2 years ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | /* |
| 2 | * The app module can be used to control a web application from javascript. |
| 3 | * Currently this isn't used by the helma command line server (server.jar), |
| 4 | * but it can be used to start the application server from the shell using |
| 5 | * the following command: |
| 6 | * |
| 7 | * importModule('app'); |
| 8 | * app.start(); |
| 9 | * |
| 10 | * It takes care of the following things: |
| 11 | * |
| 12 | * - Initializing native host objects |
| 13 | * - Setting interceptors or rules to automatically switch optimization |
| 14 | * mode on certain requests |
| 15 | * - Starting and configuring the web server |
| 16 | * |
| 17 | */ |
| 18 | |
| 19 | // import application and server module |
| 20 | importModule('helma.rhino', 'rhino'); |
| 21 | importModule('helma.jetty', 'jetty'); |
| 22 | |
| 23 | // define native host classes used by helma web apps |
| 24 | rhino.initWebApp(); |
| 25 | |
| 26 | /** |
| 27 | * Start the jetty server. |
| 28 | */ |
| 29 | function start() { |
| 30 | // start jetty http server with configuration file modules/helma/jetty.xml |
| 31 | jetty.startServer({staticDir: 'static'}); |
| 32 | } |
| 33 | |
| 34 | |
| 35 | /** |
| 36 | * Stop the jetty server. |
| 37 | */ |
| 38 | function stop() { |
| 39 | // stop jetty |
| 40 | jetty.stopServer(); |
| 41 | } |
Note: See TracBrowser for help on using the browser.