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:10:12 UTC

svn commit: r670093 - /velocity/tools/trunk/src/main/java/org/apache/velocity/tools/struts/StrutsUtils.java

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;
     }