Scriptlets

(Difference between revisions)
Jump to: navigation, search
 
m
Line 1: Line 1:
Scriptlets allow you to add Java-Code to your JSP-Pages.
+
Scriptlets are just JSP files that are composed using regular Java code instead of taglib code. Note that one doesn't exclude the other, so you can even use a mix of the two.
  
In OpenCMS jsp pages, you can retrieve the CMSObject in a scriptlet and use it as a central entry point to access many of OpenCMS' features.
+
Choosing between scriptlet code and taglib code is usually just a matter of preference.
  
 +
A typical scriptlet starts by retrieving the CmsObject, which is often a central access point for many of OpenCms' features.
  
'''Useful scriptlets'''
+
==Example scriptlets==
*[[Get the CMSObject]]
+
*[[Get the CmsObject]]
*[[Read a property of an arbitrary CMSResource]]
+
*[[Read a property of an arbitrary CmsResource]]

Revision as of 11:52, 6 April 2010

Scriptlets are just JSP files that are composed using regular Java code instead of taglib code. Note that one doesn't exclude the other, so you can even use a mix of the two.

Choosing between scriptlet code and taglib code is usually just a matter of preference.

A typical scriptlet starts by retrieving the CmsObject, which is often a central access point for many of OpenCms' features.

Example scriptlets

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox