mod_wxjs is an Apache module. Use this to create dynamic webpages with JavaScript, E4X, wxWidgets portable code, ...
Configuration
mod_wxjs is tested on Apache version 2.2.6. If you haven't installed Apache yet, I recommend you to use the latest XAMPP distribution. It contains everything you need to develop websites on an Apache server.
When you use a different version and you encounter problems, you can try to build mod_wxjs against the Apache libraries of your version.
Before you can use mod_wxjs you have to change the configuration file of Apache: httpd.conf
Path to DLL's
mod_wxjs uses several dll's. Or you make sure that the PATH environment variable is extended with the bin-directory of wxJavaScript, or you load all these DLL's with the LoadFile directive: wxmsw28u_core_vc_custom.dll, wxbase28u_net_vc_custom.dll, wxmsw28u_adv_vc_custom.dll, js.dll, libnspr4.dll, wxJS_ext.dll (On linux these files are .so files).
mod_wxjs
You have to load the wxjs module and associate the 'wxjs' handler with file extensions. These files will be processed by mod_wxjs. Other things which you can configure:
- wxJS_Modules: the path to modules.js file
- wxJS_RtSize: the size of the runtime (M --> Megabyte, K --> Kilobyte)
- wxJS_CtxSize: the size of the context (M --> Megabyte, K --> Kilobyte)
- wxJS_PreScript: the script to execute before running the main script (use a full path).
- wxJS_PostScript: the script to execute after running the main script (use a full path).
- wxJS_Encoding: the encoding of the scripts (default is UTF-8)
Keep in mind that each virtual host gets its own runtime.
LoadModule wxjs_module "c:/wxjs/bin/mod_wxjs.dll"
AddHandler wxjs .wxjs
wxJS_Modules "c:/wxjs/modules.js"
wxJS_RtSize 1M
wxJS_CtxSize 8K
An example
Each page is run in its own context. The following objects are constructed before the script is run: request which is a HttpRequest, and response which is a HttpResponse.
response.print("<html><head><title>wxJS test program</title></head><body>");
response.print("<b>Hello world</b>");
response.print("</body></html>");Read this tutorial for using mod_wxjs with the template engine and sqlite.


© 2002 - 2007 Franky Braem.