(Quick Reference)

p:textScope

Purpose

Sets the current scope (prefix) for i18n text rendered using the text tag, to either the supplied scope or the scope used for a specific plugin.

The scope is set for the current GSP or GSP fragment only.

This is especially useful in the case where an application overrides a GSP supplied by a plugin, but wishes to reuse the i18n messages supplied by the plugin. If the plugin used p:text, the overriding GSP would not use the plugin's messages. Adding this tag to your overriding GSP, using plugin="<nameOfPlugin>" will solve this.

Example

Normal scoping behaviour:
<p:text code="welcome.message"/>

Changed scope to arbitrary: <p:textScope scope="app.prefix"/> <p:text code="welcome.message"/> (always resolves to app.prefix.welcome.message)

Changed scope to arbitrary: <p:textScope plugin="springSecurityCore"/> <p:text code="welcome.message"/> (always resolves to plugin.springSecurityCore.welcome.message)

Attributes

NameRequiredPurpose
scope An arbitrary scoping prefix to use. A trailing "." will be added automatically. Example value: "myapp.messages"
plugin A plugin name in bean casing i.e. myPluginName. This makes future p:text resolutions appear to come from this plugin.