Book Image

Building Websites with OpenCms

Book Image

Building Websites with OpenCms

Overview of this book

This book takes you through the process of creating content-rich websites and applications using OpenCms. Although powerful and flexible, OpenCms can be daunting on first approach, but its advanced features reward the investment in learning. This book exists to ease Java developers into getting the most from OpenCms. OpenCms OpenCms is a professional-level, open source Website Content Management System, with which you can create and manage complex websites. Based on Java and XML technology, it fits into almost any modern IT environment. With hard-won experience of the practical difficulties faced by developers working with OpenCms, this book is the embodiment of the author's expertise, and the perfect way to master the system.
Table of Contents (12 chapters)
Building Websites with OpenCms
Credits
About the Author
Introduction

JSP Tag Libraries and Scriptlets


Already we've examined a basic example of using JSP in OpenCms. This section will discuss JSP technology and the OpenCms tag libraries and APIs.

Essentially, there are two ways of writing JSP pages. The first is to leverage tag libraries to provide all of the functionality required in a page. In this case, a JSP page looks, for the most part, like an HTML page with some extra tags. Most of the page functionality is kept separate in Java classes, and the JSP deals simply with look-and-feel issues. Because this method of development strives to implement the Model-View-Controller (MVC) design pattern, Sun actively promotes this as the preferred way of developing JSPs. Also, since JSP taglibs look like HTML tags, HTML programmers can use them without needing to know anything about the complexities of Java code.

The second method of writing JSPs (and this method can be interlaced with the first) is to embed scriptlets—small bits of Java code—inside special JSP...