You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by nb...@apache.org on 2008/06/21 01:09:02 UTC
svn commit: r670092 -
/velocity/tools/branches/1.x/src/java/org/apache/velocity/tools/struts/StrutsUtils.java
Author: nbubna
Date: Fri Jun 20 16:09:02 2008
New Revision: 670092
URL: http://svn.apache.org/viewvc?rev=670092&view=rev
Log:
getMessageResource(req,app) should check req for resources before checking app (VELTOOLS-105)
Modified:
velocity/tools/branches/1.x/src/java/org/apache/velocity/tools/struts/StrutsUtils.java
Modified: velocity/tools/branches/1.x/src/java/org/apache/velocity/tools/struts/StrutsUtils.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/1.x/src/java/org/apache/velocity/tools/struts/StrutsUtils.java?rev=670092&r1=670091&r2=670092&view=diff
==============================================================================
--- velocity/tools/branches/1.x/src/java/org/apache/velocity/tools/struts/StrutsUtils.java (original)
+++ velocity/tools/branches/1.x/src/java/org/apache/velocity/tools/struts/StrutsUtils.java Fri Jun 20 16:09:02 2008
@@ -74,10 +74,7 @@
public static MessageResources getMessageResources(HttpServletRequest request,
ServletContext app)
{
- /* Identify the current module */
- ModuleConfig moduleConfig = ModuleUtils.getInstance().getModuleConfig(request, app);
- return (MessageResources)app.getAttribute(Globals.MESSAGES_KEY +
- moduleConfig.getPrefix());
+ return getMessageResources(request, app, null);
}
@@ -94,23 +91,20 @@
ServletContext app,
String bundle)
{
- MessageResources resources = null;
-
/* Identify the current module */
ModuleConfig moduleConfig = ModuleUtils.getInstance().getModuleConfig(request, app);
-
if (bundle == null) {
bundle = Globals.MESSAGES_KEY;
}
// First check request scope
- resources = (MessageResources) request.getAttribute(bundle + moduleConfig.getPrefix());
+ MessageResources resources =
+ (MessageResources)request.getAttribute(bundle + moduleConfig.getPrefix());
if (resources == null) {
resources = (MessageResources) app.getAttribute(bundle + moduleConfig.getPrefix());
}
-
return resources;
}