8.3.5 Tag Namespaces - Reference Documentation
Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith, Lari Hotari
Version: 3.1.10
8.3.5 Tag Namespaces
By default, tags are added to the default Grails namespace and are used with theg:
prefix in GSP pages. However, you can specify a different namespace by adding a static property to your TagLib
class:class SimpleTagLib { static namespace = "my" def example = { attrs -> … } }
namespace
of my
and hence the tags in this tag lib must then be referenced from GSP pages like this:<my:example name="..." />
namespace
property. Namespaces are particularly useful for plugins.Tags within namespaces can be invoked as methods using the namespace as a prefix to the method call:out << my.example(name:"foo")