This directory contains two examples showing how the ephemeral request/response environment can be used with included pages and forwarded pages.
include/- Example showing howresponse:include()works with shared header and footer pages.forward/- Example showing howresponse:forward()hands control to other pages.include/.header.lspandinclude/.footer.lsp- Shared layout parts used by the include example.forward/first.lsp,forward/.second.lsp,forward/.third.lsp- Pages participating in the forward chain.
Run the examples separately:
cd command-env
mako -l::include
mako -l::forwardFor more detail on starting the Mako Server, see the command line video tutorial and the command line options documentation.
The examples illustrate that the request/response command environment exists only for the lifetime of a single HTTP request, but can still be used across included or forwarded pages during that request. The include example keeps rendering in the same response stream, while the forward example transfers control to another page and stops executing the current one.
- Start only one of the two example apps at a time unless you intentionally want to compare them in separate server sessions.
- The examples are easiest to understand if you read the participating LSP files in order.