Adding Message Resources

 < Day Day Up > 



The <message-resources> element is used to describe a MessageResources object for the containing application. The syntax of the <message-resources> element is:

 <message-resources   parameter="configuration parameter"   key="main" /> 

Table 15.9 describes the attributes of a <message-resources> element.

Table 15.9: The Attributes of a <message-resources> Element

Attribute

Description

className

Specifies the fully qualified class name for the message resources configuration object. The default value is org.apache.struts.config.MessageResourcesConfig. (optional)

factory

Represents the fully qualified class name for the message resources factory. The default value is org.apache.struts.util.PropertyMessageResourcesFactory. (optional)

key

Binds to the ServletContext attribute representing the Message Resource bundle. The default value is Globals.MESSAGES_KEY. (optional)

null

If this attribute is set to true, null is returned when you are searching for a missing key. The default value is false. (optional)

parameter

Represents a configuration parameter that is passed to the named factory's createResources() method. (required)

An example of using the <message-resources> element is:

 <message-resources   parameter="ch15.MainResources"   key="main" /> 



 < Day Day Up > 



Professional Jakarta Struts
Professional Jakarta Struts (Programmer to Programmer)
ISBN: 0764544373
EAN: 2147483647
Year: 2003
Pages: 183

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net