To set up Strecks, you will need to follow the following instructions.
1. Include the Strecks jar file in your Struts application class path, for example by placing it in WEB-INF/lib
2. Configure your WEB-INF/struts-config.xml to use the Strecks request processsor, for example, by adding the following entry:
<controller processorClass="org.strecks.controller.ControllerRequestProcessor" contentType="text/html;charset=utf-8" inputForward="true" nocache="true" />
If you are using Tiles, then you will want to extend TilesControllerRequestProcessor
, which
is identical to ControllerRequestProcessor
except that it extends TilesRequestProcessor
instead of RequestProcessor
.
<controller processorClass="org.strecks.controller.TilesControllerRequestProcessor" contentType="text/html;charset=utf-8" inputForward="true" nocache="true" />
3. If necessary configure Strecks by adding a strecks.properties file into your application's class path. This file is used to add interceptors as well as to configure some of the extension points. For example, the application could include a strecks.properties with the following entries:
form.wrapper.impl=org.strecks.form.handler.SessionErrorFormHandler before.interceptor.1=org.strecks.interceptor.ActionLoggingInterceptor before.interceptor.2=org.strecks.interceptor.RedirectBeforeInterceptor after.interceptor.2=org.strecks.interceptor.ActionLoggingInterceptor
The SessionErrorFormHandler
is used to enable form errors to be held temporarily in the session,
which is useful for supporting redirect after posts with form errors. The RedirectBeforeInterceptor
is provided for redirect after post support, and the ActionLoggingInterceptor
is used to log action
processing.