|
Actually PlatformResourceBundleLocator already defines a flag aggregate which determines whether resource bundles should be aggregates (in the sense multiple resource bundles of the same name should be merged). We could add an additional check in the constructor to verify whether we are in an App Engine environment (e.g. by checking for an App Engine specific class like com.google.appengine.api.utils.SystemProperty). If this is the case we disable the aggregation. We probably also need to log a warning in this case, since in the case of multiple additional constraint contribution jars some messages would be lost. The benefit of this solution is that it is transparent.
The alternative is to explicitly provide an AppEngineMessageInterpolator and just document that in an App Engine environment this interpolator has to be used (which will also not work for the multiple constraint contributor case btw). This requires in turn to configure Validator via validation.xml in an App Engine environment.
I guess the first option might be better. Thoughts?
|