map = new BundleNodeMap(name, (BundleNode)_registeredBundles.get(name));
}
else if(name.equals(DEFAULT_STRUTS_BUNDLE_NAME)) {
MessageResources resources = lookupDefaultStrutsBundle();
if(resources != null) {
BundleNode bundleNode = BundleNodeFactory.getInstance().getStrutsBundleNode(name, resources, retrieveUserLocale());
map = new BundleNodeMap(name, bundleNode);
}
}
else if(_servletContext.getAttribute(name) != null) {
MessageResources resources = lookupStrutsBundle(name);
if(resources != null) {
BundleNode bundleNode = BundleNodeFactory.getInstance().getStrutsBundleNode(name, resources, retrieveUserLocale());
map = new BundleNodeMap(name, bundleNode);
}
}
else {
ModuleConfig moduleConfig = lookupCurrentModuleConfig();
if(moduleConfig != null) {
MessageResourcesConfig[] mrs = moduleConfig.findMessageResourcesConfigs();
if(mrs != null) {
for(int i = 0; i < mrs.length; i++) {
/* skip the default bundle */
if(mrs[i].getKey().equals(Globals.MESSAGES_KEY))
continue;
else if(mrs[i].getKey().equals(name)) {
String resourceKey = mrs[i].getKey() + moduleConfig.getPrefix();
MessageResources resources = lookupStrutsBundle(resourceKey);
BundleNode bundleNode = BundleNodeFactory.getInstance().getStrutsBundleNode(name, resources, retrieveUserLocale());
map = new BundleNodeMap(name, bundleNode);
break;
}
}
}