Forward

Forwards to another page. The current page is disarded/not displayed.

Internally, a servlet RequestDispatcher is used for the forward. If a included file name is absolute (begins with a '/'), then it is relative to the servlet webapp, otherwiser it is relative to the current page.

As per the servlet API, if the response for this page has already been committed an exception will be thrown. Use/adjust page buffer sizes appropriately.

Syntax

Include sections can appear anywhere in text sections.
[forward filename ]
Quotes around the filename are optional.

The name of the forwarded file can contain expressions and hence be generated dynamically. For example:

[[ int i = 3; ]]
[forward 'foo[=i].html' ]
will forward to a file called foo3.html in the page.

Tag-Escape

To prevent the tag from being recognized, this tag can be escaped by prefixing the start tag with a backslash: \[forward

Example

An simple example of a forward. <html> <body> [forward page2.html] </body> </html> contents of page2.html