JSPs (Java Server Pages) provide a powerful way to build web pages dynamically. They are the way, web pages are generated in OpenCms. In essence a JSP is a Java program that looks like HTML code and, if executed, creates a HTML page. The particular advantage of a JSP is that arbitrary Java code can be executed to produce HTML output. There are three ways to accomplish dynamic HTML creation by executing Java code:
In order to keep your JSPs simple and maintainable, it is good style to avoid scriptlet code and use tags and the EL. For more details about JSPs in general, in particular the JSTL (the standard tag libraries) and the EL, please consult the very good books or tutorials around.
When writing JSPs in OpenCms, you should be aware of the following:
In OpenCms JSPs are used for several purposes:
To easily create JSPs for the purposes just described, OpenCms comes with a special API for JSPs that consists mainly of two parts:
This page forwards you to the relevant topics on writing JSPs in OpenCms.