velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r670093 - /velocity/tools/trunk/src/main/java/org/apache/velocity/tools/struts/StrutsUtils.java
Date Fri, 20 Jun 2008 23:10:12 GMT
Author: nbubna
Date: Fri Jun 20 16:10:11 2008
New Revision: 670093

URL: http://svn.apache.org/viewvc?rev=670093&view=rev
Log:
getMessageResource(req,app) should check req for resources before checking app (VELTOOLS-105)

Modified:
    velocity/tools/trunk/src/main/java/org/apache/velocity/tools/struts/StrutsUtils.java

Modified: velocity/tools/trunk/src/main/java/org/apache/velocity/tools/struts/StrutsUtils.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/src/main/java/org/apache/velocity/tools/struts/StrutsUtils.java?rev=670093&r1=670092&r2=670093&view=diff
==============================================================================
--- velocity/tools/trunk/src/main/java/org/apache/velocity/tools/struts/StrutsUtils.java (original)
+++ velocity/tools/trunk/src/main/java/org/apache/velocity/tools/struts/StrutsUtils.java Fri
Jun 20 16:10:11 2008
@@ -82,10 +82,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);
     }
 
 
@@ -102,23 +99,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;
     }
 



Mime
View raw message