Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

test


Stripes requires minimal configuration to get up and running, and zero configuration per ActionBean or page. That said, it is possible to change some of Stripes' behaviour using configuration. The way this is handled is that a Configuration object is responsible for supplying instances of various ConfigurableComponents to parts of Stripes that need them.

...

To specify a custom Configuration implementation use:

Property

Value

Default

Configuration.Class

The fully qualified name of a class that implements Configuration

net.sourceforge.stripes.config.RuntimeConfiguration

For example, to switch to using your own Configuration, you might make the following change to your web.xml:

...

The RuntimeConfiguration supports properties for specifying the implementation of each configured component. For more information on what each component is and what it does, click on the links for each of the interfaces. The supported properties are:

Property

Value

Default

ActionResolver.Class

The FQN of a class that implements ActionResolver

net.sourceforge.stripes.controller.NameBasedActionResolver

ActionBeanPropertyBinder.Class

The FQN of a class that implements ActionBeanPropertyBinder

net.sourceforge.stripes.controller.DefaultActionBeanPropertyBinder

ActionBeanContextFactory.Class

The FQN of a class that implements ActionBeanContextFactory

net.sourceforge.stripes.controller.DefaultActionBeanContextFactory

CoreInterceptor.Classes

Interceptors that are loaded by Stripes, regardless to Interceptor.Class param. Those are loaded before Interceptors' one, if any

net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor, net.sourceforge.stripes.controller.HttpCacheInterceptor

ExceptionHandler.Class

The FQN of a class that implements ExceptionHandler

net.sourceforge.stripes.exception.DefaultExceptionHandler

Extension.Packages

A list of packages that will be searched for Stripes extensions. Examples of extensions include interceptors, formatters, type converters, exception handlers, object post-processors (release 1.6. and later) and custom implementations of ActionResolver, ActionBeanContext, ActionBeanContextFactory, FormatterFactory, LocalePicker, LocalizationBundleFactory, MultipartWrapperFactory, PopulationStrategy, TagErrorRendererFactory, TypeConverterFactory and ObjectFactory (release 1.6 and later). Most applications can simply set the Extension.Packages, ActionResolver.Packages and Stripes.EncryptionKey parameters and be done.

No default value. If this property is not set then extension autodiscovery will be disabled.

FormatterFactory.Class

The FQN of a class that implements FormatterFactory

net.sourceforge.stripes.format.DefaultFormatterFactory

Interceptor.Classes

The comma-separated list of fully qualified class names of Interceptor classes to use. The list may contain additional whitespace. Entries higher up the list will be invoked before entries lower down.

No default values. See CoreInterceptor for others Interceptors loaded by Stripes.

LocalePicker.Class

The FQN of a class that implements LocalePicker

net.sourceforge.stripes.localization.DefaultLocalePicker

LocalizationBundleFactory.Class

The FQN of a class that implements LocalizationBundleFactory

net.sourceforge.stripes.localization.DefaultLocalizationBundleFactory

MultipartWrapperFactory.Class

The FQN of a class that implements MultipartWrapperFactory

net.sourceforge.stripes.controller.multipart.DefaultMultipartWrapperFactory

PopulationStrategy.Class

The FQN of a class that implements PopulationStrategy

net.sourceforge.stripes.tag.DefaultPopulationStrategy

TagErrorRendererFactory.Class

The FQN of a class that implements TagErrorRendererFactory

net.sourceforge.stripes.tag.DefaultTagErrorRendererFactory

TypeConverterFactory.Class

The FQN of a class that implements TypeConverterFactory

net.sourceforge.stripes.validation.DefaultTypeConverterFactory

Stripes.DebugMode

A boolean flag that turns debug mode off or on. This should only be set to true during development. Currently, debug mode only turns off encryption, allowing a developer to read values that would otherwise be encrypted before being written to the client.
WARNING: Do not turn on debug mode in a production server. When encryption is disabled, you risk exposing resources that are normally protected, such as those under /WEB-INF.

false

Stripes.EncryptionKey

A (preferably very long, very random) string that is used as the encryption key when Stripes encrypts values before sending them to the client. If no encryption key is specified, then a random one is generated each time the application is initialized. When a random key is used, encrypted values do not survive across application reloads.

No default value. A random key is generated each time the application is initialized.

Stripes.HtmlMode

The type of HTML tags Stripes should generate. Options are html or xhtml

xhtml

VFS.Classes

The comma-separated list of fully qualified class names of VFS implementations to use in addition to the built-in implementations shipped with Stripes. The list may contain additional whitespace. The implementations are tried in the order they are specified and before any built-ins.

No default value.

Anchor
ActionResolver
ActionResolver

...

The properties in this section affect how the AnnotatedClassActionResolver and NameBasedActionResolver (the only ActionResolvers included with Stripes) function. The ActionResolver is responsible for finding implementations of ActionBean at runtime. The included ActionResolvers do this by searching your web application classpath for all classes that implement ActionBean. While an exhaustive search is guaranteed to find everything, it can be quite slow. In reality your ActionBeans probably all get compiled and placed into a common package.

Property

Value

Default

ActionResolver.Packages

A comma-separated list of package roots where your ActionBean classes are. Stripes auto-discovers your ActionBeans at runtime by scanning those packages and their subpackages. This saves you from having to enumerate all your ActionBeans somewhere and maintaining that when you add, change, or remove ActionBeans.

No defaut value. This parameter is required.

Anchor
ActionBeanContextFactory
ActionBeanContextFactory

...

The DefaultActionBeanContextFactory allows you to provide an application specific subclass of ActionBeanContext to be used within your application. This is useful as it allows you to isolate yourself from any interaction with HttpServletRequest and HttpServletResponse in your ActionBeans by providing type safe getters and setters for any attributes you need to access in session etc.

Property

Value

Default

ActionBeanContext.Class

The FQN of a class which extends ActionBeanContext

net.sourceforge.stripes.action.ActionBeanContext

Anchor
LocalePicker
LocalePicker

...

The DefaultExceptionHandler does not make use of any configuration properties. However, the DelegatingExceptionHandler also included in Stripes does. Like the ActionResolvers, it scans the classpath for classes (in this case AutoExceptionHandler classes), and can be configured to look in only specific places.

Property

Value

Default

DelegatingExceptionHandler.Packages

A comma separated list of package roots where your ExceptionHandlers are. Stripes will also search the packages specified in Extension.Packages for ExceptionHandlers so this parameter usually is not necessary.

Empty - search the packages specified by Extension.Packages.

LocalePicker Properties

The LocalePicker is responsible for picking the Locale under which a request will be processed, and optionally a character encoding. In non-localized systems this is usually just the system locale and character encoding, but in localized systems a match needs to be performed between the list of Locales the user accepts and the list of Locales the server can provide. Properties in this section affect how the DefaultLocalePicker (the only LocalePicker included with Stripes) functions.

Property

Value

Default

LocalePicker.Locales

A comma separated list of locales that the system supports. Each locale can be one to three segments long (e.g. en or en-us or en-us-mac). Either hypens or underscores can be used to separate the segments. In addition each locale can optinally include a character encoding to use with that locale. The character encoding is specified by appending :encoding to the locale, e.g. en_US:UTF-8

The system default locale as returned by Locale.getDefault().

Anchor
LocalizationBundleFactory
LocalizationBundleFactory

...

The LocalizationBundleFactory is responsible for providing the rest of Stripes somewhere to lookup localized resources. At present Stripes defines two types of resources - error messages and field names - that may be looked up from the same or different bundles. The properties in this section affect how the DefaultLocalizationBundleFactory (the only LocalizationBundleFactory included with Stripes) operates.

Property

Value

Default

LocalizationBundleFactory.ErrorMessageBundle

The name of a resource bundle. This may by any kind of resource bundle, but will typically be a property resource bundle, in which case the resource files should be available in the classpath.

StripesResources which will lead to a file called StripesResources.properties being looked for on the classpath, and potentially locale specific properties files as well.

LocalizationBundleFactory.FieldNameBundle

The name of a resource bundle. This may by any kind of resource bundle, but will typically be a property resource bundle, in which case the resource files should be available in the classpath.

StripesResources which will lead to a file called StripesResources.properties being looked for on the classpath, and potentially locale specific properties files as well.

Anchor
File Upload Properties
File Upload Properties

...

Stripes provides an easy way to process file uploads using the HTTP multipart/form-data standard. This section documents properties that affect how the file upload process works.

Property

Value

Default

FileUpload.MaximumPostSize

The maximum HTTP Post size, in bytes, that will be accepted by the server. Note that this is not the maximum file size, but the combined size of all files in a single upload plus any other form fields and headers. In practical terms, this should be slightly larger (say 20-50k) than the maximum file size you want to handle, in order to allow for a reasonable amount of other data to come in the same request. The number is assumed to be in bytes unless a k/kb/m/mb/g/gb suffix is applied.

10 Megabytes.

MultipartWrapper.Class

The fully qualified name of the class, implementing MultipartWrapper.

net.sourceforge.stripes.controller.multipart.CommonsMultipartWrapper

Validation Properties

By default Stripes will not invoke the validation methods on ActionBeans if earlier validations (type conversion and annotation driven validation) resulted in validation errors. This behaviour can be overridden:

Property

Value

Default

Validation.InvokeValidateWhenErrorsExist

When true Stripes will call the validate() method regardless of whether earlier validation phases produced validation errors or not. (Introduced in Stripes 1.2)

false

...