velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r536297 - in /velocity/tools/branches/2.x: src/main/java/org/apache/velocity/tools/struts/StrutsUtils.java xdocs/changes.xml
Date Tue, 08 May 2007 18:54:55 GMT
Author: nbubna
Date: Tue May  8 11:54:53 2007
New Revision: 536297

URL: http://svn.apache.org/viewvc?view=rev&rev=536297
Log:
merge of r536295 (VELTOOLS-82)

Modified:
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/StrutsUtils.java
    velocity/tools/branches/2.x/xdocs/changes.xml

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/StrutsUtils.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/StrutsUtils.java?view=diff&rev=536297&r1=536296&r2=536297
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/StrutsUtils.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/StrutsUtils.java
Tue May  8 11:54:53 2007
@@ -404,10 +404,28 @@
     {
         ModuleConfig moduleConfig = ModuleUtils.getInstance().getModuleConfig(request, app);
         //TODO? beware of null module config if ActionServlet isn't init'ed?
-        ForwardConfig fc = moduleConfig.findForwardConfig(forward);
-        if (fc == null)
+
+        ActionConfig actionConfig =
+            (ActionConfig)request.getAttribute(Globals.MAPPING_KEY);
+
+        // NOTE: ActionConfig.findForwardConfig only searches local forwards
+        ForwardConfig fc = null;
+        if(actionConfig != null)
         {
-            return null;
+            fc = actionConfig.findForwardConfig(forward);
+
+            // No ActionConfig forward?
+            // Find the ForwardConfig in the global-forwards.
+            if(fc == null)
+            {
+                fc = moduleConfig.findForwardConfig(forward);
+
+                // ok, give up
+                if (fc == null)
+                {
+                    return null;
+                }
+            }
         }
 
         StringBuffer url = new StringBuffer();

Modified: velocity/tools/branches/2.x/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/xdocs/changes.xml?view=diff&rev=536297&r1=536296&r2=536297
==============================================================================
--- velocity/tools/branches/2.x/xdocs/changes.xml (original)
+++ velocity/tools/branches/2.x/xdocs/changes.xml Tue May  8 11:54:53 2007
@@ -32,6 +32,9 @@
     <subsection name="1.4-dev">
         <p>This section describes changes after the 1.3 release.</p>
         <ul>
+        <li>Changed StrutsLinkTool.setForward() to look for forwards local to the action
mapping, before looking up global forwards. Thanks to Christopher Schultz. (ndb)</li>
+        <li>Added propertyKey() and propertyValue() escaping support to EscapeTool
(VELTOOLS-81). Thanks to Phil Cornelius for this patch. (ndb)</li>
+        <li>Fixed bug in request-path restriction when using wildcards. (ndb)</li>
         <li>Make default locale and format for NumberTool configurable, just as they
are in DateTool. (ndb)</li>
         <li>Add ComparisonDateTool (with some tests and showcase demos) for comparing
dates and displaying the comparisons textually. Thanks to Chris Townsen for the initial implementation.
(ndb)</li>
         <li>Add ability to configure default Locale for DateTool and to lock down configure()
so it is safe to use in application scope. (ndb)</li>



Mime
View raw message