Simple Naws examples*
This distribution contains many sample templates and configurations
in the "samples" resource. They may be extracted with:
java -jar brazil.jar samples
Here is a sample of some of the examples included in the distribution:
- after configuration,markup
- How to use the <after> tag to run markup some time in the future
- agi configuration,markup
- How to use the Brazil server to act as an Asterisk "agi" script, using the fast AGI protocol
- amicommand configuration,markup
- How to issue Asterisk manager commands from an html template.
- basicssl configuration
- How to set up an "SSL" server.
- bean configuration,markup
- How to include beanshell scripts in your templates
- builtin configuration
- This is the configuration that is "built-in" to the jar file as distributed.
- cgi configuration
- How to run a CGI script.
- chat configuration,markup
- Demonstrates the use of the QueueTemplate with Ajax to build a self-contained chat system
- derby configuration,markup
- How to run Brazil with "JavaDB" (aka Derby, aka cloudscape)
- fcgi configuration
- How to setup PHP and Python to run in Fast-CGI mode.
- form configuration,markup
- How to process HTML forms.
- groovy configuration,markup
- How to include groovy scripts inside a template.
- highlight configuration,markup
- How to set up a proxy that automatically rewrites html contentbased on a
user supplied regular expression. This is a global "find all and hightlight" proxy.
- interp configuration,markup
- How to configure the server to support JSR223 "scripting languages".
- This one has a template with Javascript, Ruby, and PHP all in one page (Aargh!)
- json configuration,markup
- How to generate JSON output from a template
- macro configuration,markup
- How to use the Brazil Macro facility
- misc configuration,markup
- Sample uses of the "Miscelaneous" template for String manipulation
- nat configuration,markup
- How to set up a suite of Servers hidden behind a NAT box
- php configuration
- How to use the CGI handler to server PHP
- proxy configuration,markup
- Another simple site + proxy example.
- resource configuration,markup
- How to configure a "self contained" server, with all the content in the jar file.
- restart configuration,markup
- How to configure the server to be "self restarting".
- scan configuration,markup
- How to use the Scan template to process html and/or xml and/or *ml like documents
- smtp configuration,markup
- How to send an email message from the server
- sort configuration,markup
- Examples of sorting using the "sort" attribute in the BSL template.
- sql configuration,markup
- How to interface with SQL via JDBC
- validate configuration,markup
- How to use the ValidateTemplate for server-side form validation
- vote configuration,markup
- How to pack an entire web site in a single template (this is my favorite simple example).
* "Simple" examples, in this context means Brazil configurations that
demonstrate a single concept (or small number of inter-related
concepts) that can be expressed by at most one configuration file
and one template (e.g html) file.
Some examples are complete as-is, some demonstrate a specific
capability in isolation. All should be runnable, providing any
additional jar files (as indicated in the configuration files)
are in the classpath.
Back to overview