java -jar stripes-reload.jar.
Stripes-Reload is a set of Stripes extensions that reload some of your Stripes-associated classes without having to restart the server so that you see your changes immediately. Stripes-Reload detects changes and reloads the following:
For Action Beans, Type Converters, and Formatters, Stripes-Reload also detects new classes. For example, while your server is already running, you can add a new Action Bean, make a request to its URL binding, and Stripes-Reload will discover and load the newly added Action Bean.
For new classes to be discovered, they must be in a package that you
have configured in web.xml with ActionResolver.Packages for
Action Beans, and Extension.Packages for Type Converters and
Formatters.
For resource bundles (StripesResources.properties by default), you
will see your changes for Stripes-managed localization, such as labels
for form input fields, submit buttons, error message text, and so on.
JSTL-managed localization such as text rendered with the <fmt:message> tag
will also be reloaded, as long as you configure the resource bundle in
web.xml as follows:
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>StripesResources</param-value>
<!-- (you can use a different name instead of StripesResources if you wish.) -->
</context-param>
IMPORTANT: Stripes-Reload is NOT meant for use in production. It is NOT optimized for performance, memory usage, and so on. Stripes-Reload is meant to be used in your local development environment for you to see some of your code changes immediately without having to restart your server.
IMPORTANT:
.class
files.
Stripes-Reload is very easy to set up: just add the
stripes-reload.jar
file in the WEB-INF/lib directory of your web application, and add
org.stripesbook.reload.extensions to the Extension.Packages
initialization parameter for the Stripes Filter in web.xml:
<filter>
<filter-name>StripesFilter</filter-name>
<filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
<init-param>
<param-name>ActionResolver.Packages</param-name>
<param-value>...</param-value>
</init-param>
<init-param>
<param-name>Extension.Packages</param-name>
<param-value>org.stripesbook.reload.extensions</param-value>
</init-param>
</filter>
Once you have that set up, start the server to run your application.
Make sure that when you make changes, the modified files are placed in
the directories from which the server is running the application
(typically files under the WEB-INF/classes directory). You should
see your changes by refreshing the request in your browser.
You can also use some parts of Stripes-Reload and not others. For
example, you could just use the extension that reloads Action Beans.
In this case, do not add org.stripesbook.reload.extensions to the
Extension.Packages initialization parameter. Instead, configure
each extension that you want to use separately. For example:
<filter>
<filter-name>StripesFilter</filter-name>
<filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
<init-param>
<param-name>ActionResolver.Packages</param-name>
<param-value>org.stripesbook.reload.example.action</param-value>
</init-param>
<init-param>
<param-name>ActionResolver.Class</param-name>
<param-value>org.stripesbook.reload.extensions.ReloadActionResolver</param-value>
</init-param>
</filter>
You can easily take Stripes-Reload out for a spin if you have Apache Ant installed.
JETTY_HOME environment variable to the full path
of the jetty-6-1.10 directory.
JETTY_HOME/lib directory.
stripes-reload-example directory, and run ant.
This will run the example application with Jetty, which you can access
with http://localhost:8080/stripes-reload-example in your browser.
StripesResources.properties file inside the example project, and
recompile the application. You can use a plain editor and recompile
the application with ant compile, or you can import the example
into an IDE. The example already includes a project that you can
import into Eclipse, as well as a project for
NetBeans. You can then make changes and have
the IDE recompile the project.
Stripes-Reload is a set of Stripes extensions that augment the default factories for Action Beans, Type Converters, Formatters, and Resource Bundles. An Interceptor handles reloading the JSTL resource bundle.
IMPORTANT: Stripes-Reload includes a custom ActionResolver,
TypeConverterFactory, FormatterFactory, and
LocalizationBundleFactory. Therefore, if you already have your own
custom implementation of any of those factories, you will not be able
to use the Stripes-Reload version unless you temporarily make your
custom implementation extend the Stripes-Reload implementation. In
that case, do not add org.stripesbook.reload.extensions to
Extension.Packages; have your custom implementation be loaded
instead.
There are several ways to set up a web application with Tomcat. One
way that works well with Stripes-Reload is to set up a context file in
$CATALINA_HOME/conf/Catalina/localhost/your-web-app.xml. For
example:
<!-- Put this file in
$CATALINA_HOME/conf/Catalina/localhost/stripes-reload-example.xml -->
<Context docBase="/path/to/stripes-reload-example/web">
</Context>
Please send your comments to Frederic Daoud: xf2697 @_AT_@ fastmail %_DOT_% fm