O'Reilly logo

Managing and Customizing OpenCms 6 by Matt Butcher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

JSP Scriptlets

JSP tags provide one way of providing dynamic content in a JSP page, but the other way is to use JSP scriptlets. Scriptlets are pieces of Java code that can be inserted within a document. The idea of inserting code in a document is similar to JavaScript, except that in this case, it is the server, not the client, that executes the code. The code is fully fledged Java in all its object-oriented glory. If you are going to write scriptlets, you will need to know Java.

If you do not know Java, you may want to skip to this section. We will be using JSP tags in this book, and you can comfortably write OpenCms templates without writing any scriptlets.

To give an idea of how scriptlets work, here is what the previous example would look like ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required