Class ResourceSettings

java.lang.Object
org.apache.wicket.settings.ResourceSettings
All Implemented Interfaces:
IPropertiesFactoryContext

public class ResourceSettings extends Object implements IPropertiesFactoryContext
Class for resource related settings

resourcePollFrequency (defaults to no polling frequency) - Frequency at which resources should be polled for changes.

resourceFinders - Add/modify this to alter the search path for resources.

useDefaultOnMissingResource (defaults to true) - Set to true to return a default value if available when a required string resource is not found. If set to false then the throwExceptionOnMissingResource flag is used to determine how to behave. If no default is available then this is the same as if this flag were false

A ResourceStreamLocator - An Application's ResourceStreamLocator is used to find resources such as images or markup files. You can supply your own ResourceStreamLocator if your prefer to store your application's resources in a non-standard location (such as a different filesystem location, a particular JAR file or even a database) by overriding the getResourceLocator() method.

Resource Factories - Resource factories can be used to create resources dynamically from specially formatted HTML tag attribute values. For more details, see IResourceFactory, DefaultButtonImageResourceFactory and especially LocalizedImageResource.

A Localizer The getLocalizer() method returns an object encapsulating all of the functionality required to access localized resources. For many localization problems, even this will not be required, as there are convenience methods available to all components: Component.getString(String key) and Component.getString(String key, org.apache.wicket.model.IModel model).

stringResourceLoaders - A chain of IStringResourceLoader instances that are searched in order to obtain string resources used during localization. By default the chain is set up to first search for resources against a particular component (e.g. page etc.) and then against the application.

Author:
Jonathan Locke, Chris Turner, Eelco Hillenius, Juergen Donnerstag, Johan Compagner, Igor Vaynberg (ivaynberg), Martijn Dashorst, James Carman
  • Constructor Details

    • ResourceSettings

      public ResourceSettings(Application application)
      Configures Wicket's default ResourceLoaders.
      For an example in FooApplication let bar.Foo extend Component, this results in the following ordering:
      component specific
      • bar/Foo.properties
      • org/apache/wicket/Component.properties
      package specific
      • bar/package.properties
      • package.properties (on Foo's class loader)
      • org/apache/wicket/package.properties
      • org/apache/package.properties
      • org/package.properties
      • package.properties (on Component's class loader)
      application specific
      • FooApplication.properties
      • Application.properties
      validator specific
      Initializer specific
      • bar.Foo.properties (Foo implementing IInitializer)
      Parameters:
      application -
  • Method Details