Hi all,
as requested i implemented the ResolutionResolver mechanims using Stripes
interceptor/Lifecycle features.
Configuration:
---------------------------
Add the following filter parameter
<init-param>
<param-name>Interceptor.Classes</param-name>
<param-value>
org.syracus.stripes.resolution.ResolutionInterceptor,
net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor
</param-value>
</init-param>
You can for sure mix with other interceptors like SpringInterceptor if you
like.
The default ResolutionResolver is ResourceBundledResolutionResolver. If you
want to implement your own just implement the interface ResolutionResolver
and set the additional configuration parameter
<init-param>
<param-name>ResolutionResolver.Class</param-name>
<param-value>
MyResolutionResolverImplementation
</param-value>
</init-param>
By default ResourceBundleResolutionResolver checks StripesResources.properties
for path mappings. To configure other resource bundles add the parameter
<init-param>
<param-name>ResourceBundleResolutionResolver.ResourceBundles</param-name>
<param-value>TestBundle,StripesResources</param-value>
</init-param>
You can specify a comma-separated list of resource bundle names.
Usage:
--------------
Nothing special to mention here. The ResolutionInterceptor is called on
Lifecycle.ResolutionExecution automatically if registered on StripesFilter.
It operates on all Resolutions implementing at least OnwardResolution.
(ForwardResolution and RedirectResolution).
return( new ForwardResolution( "success" ) );
The process of looking up a proper mapping for the given path is the following
in that order.
<FullqualifiedActionClass>.<Event>.<Key>
<FullqualifiedActionClass>.<Key>
<UrlBinding>.<Event>.<Key>
<UrlBinding>.<Key>
<Event>.<Key>
<Key>
First match wins.
If no match could be found in all configured ResourceBundles the original path
of the resolution is used.
Releases:
--------------------
Current release 1.2 can be downloaded from
https://sourceforge.net/project/showfiles.php?group_id=175565.
I decided to split the jars into resolution and scripting dependend, so you
don't have to include bsf framework if you only want to use the resolution
features ;)
Drawbacks
----------------------
The MessageFormat mechanism from version 1.1 is no longer available. This is
because i havent't found a good way to pass additional replacement attributes
to the ResolutionResolver.
One solution would be to provide special implementations like the prior
ResourceBundleForwardResolution and ResourceBundleRedirectResolution
which accept message format parameters.
Please let me know if someone requires this feature, and i'll try to find a
solution for this.
Greets
Sebastian
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development