Java Reference
In-Depth Information
Using an Empty Class or a Configuration Parameter to Load a
Stripes Extension
We added an empty class that extends BeanFirstPopulationStrat-
egy as a way of loading a Stripes extension. I like using this trick
because no additional configuration is involved, all extensions
are together in an extension package, and I'll have a class
ready if I need to customize the population strategy. If you don't
like this empty class idea, you can use a configuration param-
eter in web.xml instead:
<filter>
<filter-name> StripesFilter </filter-name>
<filter-class>
net.sourceforge.stripes.controller.StripesFilter
</filter-class>
<!-- ... -->
<!-- Configure the population strategy -->
<init-param>
<param-name> PopulationStrategy.Class </param-name>
<param-value>
net.sourceforge.stripes.tag.BeanFirstPopulationStrategy
</param-value>
</init-param>
</filter>
In fact, you always have the choice of getting Stripes to load
an extension either by adding it to an extension package or
by configuring it explicitly with a web.xml parameter. For a com-
plete list of configuration parameters, check out Appendix A ,
on page 369 .
Figure 9.2: Fields for uploading attachments
 
 
 
Search WWH ::




Custom Search