Configuring components via property settings
Seam components may be provided with configuration properties either via servlet context parameters, or via a properties file named seam.properties
in the root of the classpath.
The configurable Seam component must expose JavaBeans-style property setter methods for the configurable attributes. If a seam component named com.jboss.myapp.settings
has a setter method named setLocale()
, we can provide a property named com.jboss.myapp.settings.locale
in the seam.properties
file or as a servlet context parameter, and Seam will set the value of the locale
attribute whenever it instantiates the component.
The same mechanism is used to configure Seam itself. For example, to set the conversation timeout, we provide a value for org.jboss.seam.core.manager.conversationTimeout
in web.xml
or seam.properties
. (There is a built-in Seam component named org.jboss.seam.core.manager
with a setter method named setConversationTimeout()
.)