Fork me on GitHub

The following Jelly tag libraries are defined in this project.

Namespace URI Description
jelly:jelly

This package contains the main jelly API classes.

jelly:impl

Core implementation classes for Jelly.

jelly:core

The core Tags from the JSTL plus Jelly extensions.

jelly:xpath

jelly:jelly

This package contains the main jelly API classes.

This tag library is also available as an XML Schema

Tag Name Description

jelly:impl

Core implementation classes for Jelly.

This tag library is also available as an XML Schema

Tag Name Description
dynamic
dynamicBean

This tag is bound onto a Java Bean class. When the tag is invoked a bean will be created using the tags attributes. The bean may also have an invoke method called invoke(), run(), execute() or some such method which will be invoked after the bean has been configured.

dynamicDynaBean

This tag is bound onto a DynaClass instance. When the tag is invoked a DynaBean will be created using the tags attributes. So this class is like a DynaBean implemenation of DynamicBeanTag

static

dynamic

Attribute Name Type Description
template org.apache.commons.jelly.Script

dynamicBean

This tag is bound onto a Java Bean class. When the tag is invoked a bean will be created using the tags attributes. The bean may also have an invoke method called invoke(), run(), execute() or some such method which will be invoked after the bean has been configured.

Attribute Name Type Description
dynaBean org.apache.commons.beanutils.DynaBean

Sets the DynaBean which is used to store the attributes of this tag

dynamicDynaBean

This tag is bound onto a DynaClass instance. When the tag is invoked a DynaBean will be created using the tags attributes. So this class is like a DynaBean implemenation of DynamicBeanTag

Attribute Name Type Description
dynaBean org.apache.commons.beanutils.DynaBean

Sets the DynaBean which is used to store the attributes of this tag

static

Attribute Name Type Description
QName java.lang.String
localName java.lang.String
uri java.lang.String

jelly:core

The core Tags from the JSTL plus Jelly extensions.

This tag library is also available as an XML Schema

Tag Name Description
arg

An argument to a NewTag or InvokeTag. This tag MUST be enclosed within an ArgTagParent implementation.

break

A tag which terminates the execution of the current <forEach> or <while> loop. This tag can take an optional boolean test attribute which if its true then the break occurs otherwise the loop continues processing.

case

A tag which conditionally evaluates its body if my value attribute equals my ancestor <switch> tag's "on" attribute.

This tag must be contained within the body of some <switch> tag.

catch

A tag which catches exceptions thrown by its body. This allows conditional logic to be performed based on if exceptions are thrown or to do some kind of custom exception logging logic.

choose

A tag which conditionally evaluates its body based on some condition

default

A tag which conditionally evaluates its body if none of its preceeding sibling <case> tags have been evaluated.

This tag must be contained within the body of some <switch> tag.

expr

A tag which evaluates an expression

file

A tag that pipes its body to a file denoted by the name attribute or to an in memory String which is then output to a variable denoted by the var variable.

forEach

Iterates over a collection, iterator or an array of objects. Uses the same syntax as the

tag does.

getStatic

A tag which can retrieve the value of a static field of a given class. The following attributes are required:

Example usage:

if

A tag which conditionally evaluates its body based on some condition

import

Imports another script.

include

A tag which conditionally evaluates its body based on some condition

invoke

A tag which calls a method in an object instantied by core:new

invokeStatic

A Tag which can invoke a static method on a class, without an instance of the class being needed.

jelly

The root Jelly tag which should be evaluated first

mute

A tag which executes its body but passing no output.

new

A tag which creates a new object of the given type

otherwise

The otherwise block of a choose/when/otherwise group of tags

parse

Parses the output of this tags body or of a given String as a Jelly script then either outputting the Script as a variable or executing the script.

remove

A tag which removes the variable of the given name from the current variable scope.

scope

A tag which creates a new child variable scope for its body. So any variables defined within its body will no longer be in scope after this tag.

set

A tag which sets a variable from the result of an expression

setProperties

A tag which sets the bean properties on the given bean. So if you used it as follows, for example using the <j:new> tag.

Then it would set the name and location properties on the bean denoted by the expression ${person}.

switch

Executes the child <case> tag whose value equals my on attribute. Executes a child <default> tag when present and no <case> tag has yet matched.

thread

A tag that spawns the contained script in a separate thread

useBean

A tag which instantiates an instance of the given class and then sets the properties on the bean. The class can be specified via a java.lang.Class instance or a String which will be used to load the class using either the current thread's context class loader or the class loader used to load this Jelly library.

This tag can be used it as follows,

useList

A tag which creates a List implementation and optionally adds all of the elements identified by the items attribute. The exact implementation of List can be specified via the class attribute

when

A tag which conditionally evaluates its body based on some condition

while

A tag which performs an iteration while the result of an expression is true.

whitespace

A simple tag used to preserve whitespace inside its body

arg

An argument to a NewTag or InvokeTag. This tag MUST be enclosed within an ArgTagParent implementation.

Attribute Name Type Description
classLoader java.lang.ClassLoader

Set the class loader to be used for instantiating application objects when required.

type java.lang.String

The name of the argument class or type, if any. This may be a fully specified class name or a primitive type name ( , , , etc.).

useContextClassLoader boolean

Determine whether to use the Context ClassLoader (the one found by calling ) to resolve/load classes. If not using Context ClassLoader, then the class-loading defaults to using the calling-class' ClassLoader.

value java.lang.Object

The (possibly null) value of this argument.

break

A tag which terminates the execution of the current <forEach> or <while> loop. This tag can take an optional boolean test attribute which if its true then the break occurs otherwise the loop continues processing.

Attribute Name Type Description
test org.apache.commons.jelly.expression.Expression

Sets the Jelly expression to evaluate (optional). If this is or evaluates to

then the loop is terminated

var java.lang.String

Sets the variable name to export indicating if the item was broken

case

A tag which conditionally evaluates its body if my value attribute equals my ancestor <switch> tag's "on" attribute.

This tag must be contained within the body of some <switch> tag.

Attribute Name Type Description
fallThru boolean
value org.apache.commons.jelly.expression.Expression

catch

A tag which catches exceptions thrown by its body. This allows conditional logic to be performed based on if exceptions are thrown or to do some kind of custom exception logging logic.

Attribute Name Type Description
var java.lang.String

Sets the name of the variable which is exposed with the Exception that gets thrown by evaluating the body of this tag or which is set to null if there is no exception thrown.

choose

A tag which conditionally evaluates its body based on some condition

default

A tag which conditionally evaluates its body if none of its preceeding sibling <case> tags have been evaluated.

This tag must be contained within the body of some <switch> tag.

Attribute Name Type Description
fallThru boolean

expr

A tag which evaluates an expression

Attribute Name Type Description
value org.apache.commons.jelly.expression.Expression

Sets the Jexl expression to evaluate.

file

A tag that pipes its body to a file denoted by the name attribute or to an in memory String which is then output to a variable denoted by the var variable.

Attribute Name Type Description
append boolean

Sets wether to append at the end of the file (not really something you normally do with an XML file).

encoding java.lang.String

Sets the XML encoding mode, which defaults to UTF-8

name java.lang.String

Sets the file name for the output

omitXmlDeclaration boolean

Sets whether the XML declaration should be output or not

outputMode java.lang.String

Sets the output mode, whether XML or HTML

prettyPrint boolean

Sets whether pretty printing mode is turned on. The default is off so that whitespace is preserved

var java.lang.String

Sets the var.

forEach

Iterates over a collection, iterator or an array of objects. Uses the same syntax as the

tag does.

Attribute Name Type Description
begin int

Sets the starting index value

end int

Sets the ending index value

indexVar java.lang.String

Sets the variable name to export the current index counter to

items org.apache.commons.jelly.expression.Expression

Sets the expression used to iterate over. This expression could resolve to an Iterator, Collection, Map, Array, Enumeration or comma separated String.

step int

Sets the index increment step

var java.lang.String

Sets the variable name to export for the item being iterated over

varStatus java.lang.String

Sets the variable name to export the current status to. The status is an implementation of the JSTL LoopTagStatus interface that provides the following bean properties:

getStatic

A tag which can retrieve the value of a static field of a given class. The following attributes are required:

Example usage:

Attribute Name Type Description
className java.lang.String

Sets the fully qualified name of the class containing the static field.

field java.lang.String

Sets the name of the field to retrieve.

var java.lang.String

Sets the name of the variable exported by this tag.

if

A tag which conditionally evaluates its body based on some condition

Attribute Name Type Description
test org.apache.commons.jelly.expression.Expression

Sets the Jelly expression to evaluate. If this returns true, the body of the tag is evaluated

import

Imports another script.

Attribute Name Type Description
file java.lang.String

Sets the file for the script to evaluate.

inherit boolean

Sets whether property inheritence is enabled or disabled

uri java.lang.String

Sets the URI (relative URI or absolute URL) for the script to evaluate.

include

A tag which conditionally evaluates its body based on some condition

Attribute Name Type Description
export java.lang.String
file java.io.File

Sets the file to be included which is either an absolute file or a file relative to the current directory

inherit java.lang.String
uri java.lang.String

Sets the URI (relative URI or absolute URL) for the script to evaluate.

invoke

A tag which calls a method in an object instantied by core:new

Attribute Name Type Description
exceptionVar java.lang.String

Sets the name of a variable that exports the exception thrown by the method's invocation (if any)

method java.lang.String
on java.lang.Object
var java.lang.String

Sets the name of the variable exported by this tag

invokeStatic

A Tag which can invoke a static method on a class, without an instance of the class being needed.

Attribute Name Type Description
className java.lang.String

Sets the fully qualified class name containing the static method

exceptionVar java.lang.String

Sets the name of a variable that exports the exception thrown by the method's invocation (if any)

method java.lang.String

Sets the name of the method to invoke

var java.lang.String

Sets the name of the variable exported by this tag

jelly

The root Jelly tag which should be evaluated first

mute

A tag which executes its body but passing no output.

new

A tag which creates a new object of the given type

Attribute Name Type Description
classLoader java.lang.ClassLoader

Set the class loader to be used for instantiating application objects when required.

className java.lang.String

Sets the class name of the object to instantiate

useContextClassLoader boolean

Determine whether to use the Context ClassLoader (the one found by calling ) to resolve/load classes. If not using Context ClassLoader, then the class-loading defaults to using the calling-class' ClassLoader.

var java.lang.String

Sets the name of the variable exported by this tag

otherwise

The otherwise block of a choose/when/otherwise group of tags

parse

Parses the output of this tags body or of a given String as a Jelly script then either outputting the Script as a variable or executing the script.

Attribute Name Type Description
XMLReader org.xml.sax.XMLReader

Sets the XMLReader used for parsing

jellyParser org.apache.commons.jelly.parser.XMLParser

Sets the jellyParser.

text java.lang.String

Sets the text to be parsed by this parser

var java.lang.String

Sets the variable name that will be used for the Document variable created

remove

A tag which removes the variable of the given name from the current variable scope.

Attribute Name Type Description
var org.apache.commons.jelly.expression.Expression

Sets the name of the variable which will be removed by this tag..

scope

A tag which creates a new child variable scope for its body. So any variables defined within its body will no longer be in scope after this tag.

set

A tag which sets a variable from the result of an expression

Attribute Name Type Description
defaultValue org.apache.commons.jelly.expression.Expression

Sets the default value to be used if the value exprsesion results in a null value or blank String

encode boolean

Sets whether the body of the tag should be XML encoded as text (so that < and > are encoded as &lt; and &gt;) or leave the text as XML which is the default. This is only used if this tag is specified with no value so that the text body of this tag is used as the body.

property java.lang.String

Sets the name of the property to set on the target object.

scope java.lang.String

Sets the variable scope for this variable. For example setting this value to 'parent' will set this value in the parent scope. When Jelly is run from inside a Servlet environment then other scopes will be available such as 'request', 'session' or 'application'.

Other applications may implement their own custom scopes.

target java.lang.Object

Sets the target object on which to set a property.

value org.apache.commons.jelly.expression.Expression

Sets the expression to evaluate.

var java.lang.String

Sets the variable name to define for this expression

setProperties

A tag which sets the bean properties on the given bean. So if you used it as follows, for example using the <j:new> tag.

Then it would set the name and location properties on the bean denoted by the expression ${person}.

switch

Executes the child <case> tag whose value equals my on attribute. Executes a child <default> tag when present and no <case> tag has yet matched.

Attribute Name Type Description
on org.apache.commons.jelly.expression.Expression

Sets the value to switch on. Note that the Expression is evaluated only once, when the <switch> tag is evaluated.

thread

A tag that spawns the contained script in a separate thread

Attribute Name Type Description
file java.lang.String

Set the file which is generated from the output

name java.lang.String

Sets the name of the thread.

xmlOutput org.apache.commons.jelly.XMLOutput

Sets the destination of output

useBean

A tag which instantiates an instance of the given class and then sets the properties on the bean. The class can be specified via a java.lang.Class instance or a String which will be used to load the class using either the current thread's context class loader or the class loader used to load this Jelly library.

This tag can be used it as follows,

Attribute Name Type Description
ignoreUnknownProperties boolean

If this tag finds an attribute in the XML that's not ignored by #ignoreProperties and isn't a bean property, should it throw an exception?

useList

A tag which creates a List implementation and optionally adds all of the elements identified by the items attribute. The exact implementation of List can be specified via the class attribute

Attribute Name Type Description
ignoreUnknownProperties boolean

If this tag finds an attribute in the XML that's not ignored by #ignoreProperties and isn't a bean property, should it throw an exception?

when

A tag which conditionally evaluates its body based on some condition

Attribute Name Type Description
test org.apache.commons.jelly.expression.Expression

Sets the expression to evaluate.

while

A tag which performs an iteration while the result of an expression is true.

Attribute Name Type Description
test org.apache.commons.jelly.expression.Expression

Setter for the expression

whitespace

A simple tag used to preserve whitespace inside its body

jelly:xpath

This tag library is also available as an XML Schema

Tag Name Description