Hi,
I am trying to write an interceptor that will put in key value pairs for
things that are not in the ResourceBundle.
Can someone please help? There are so many contexts, that I am not sure how
to set them.
Suppose I have a Map<String, String> that I want to put in such that
%getText(...) will find them.
Please any pointers gratefully received!
public String intercept(ActionInvocation invocation) throws Exception {
log.debug("Overriding the resource bundle");
Map<String, Object> overrides = new HashMap<String, Object>();
overrides.put("hello.world.text", "overriden");
invocation.getInvocationContext().getValueStack().setExprOverrides(overrides);
return invocation.invoke();
}
The reason I am doing this, is because I actually have code for a
MergedResourceBundle that reads and merges multiple property files of the
same path and name (different jars). Unfortunately the struts2 boils down
to a ResourceBundle.getResourceBundle(...) in LocalizedTextUtil which will
only grab one file. If someone can suggest a better approach to having this
read multiple ApplicationResources.properties I would gratefully receive
that too.
Tim