r9539 - helma-ng/trunk/modules/helma

[email protected]
Newsgroups gmane.comp.java.helma.cvs
Message-ID <20090316141656.CD2943D0D6@mia>
Author: hannes
Date: 2009-03-16 15:16:56 +0100 (Mon, 16 Mar 2009)
New Revision: 9539

Modified:
   helma-ng/trunk/modules/helma/webapp.js
Log:
Only resolve extra path elements to extra arguments if action has matching arguments declaration.

Details at http://dev.helma.org/trac/helma/changeset/9539

Modified: helma-ng/trunk/modules/helma/webapp.js
===================================================================
--- helma-ng/trunk/modules/helma/webapp.js	2009-03-16 14:15:48 UTC (rev 9538)
+++ helma-ng/trunk/modules/helma/webapp.js	2009-03-16 14:16:56 UTC (rev 9539)
@@ -1,4 +1,4 @@
-/*
+11/*
  * The webapp module provides support for building web applications in Helma NG.
  */
 
@@ -91,7 +91,7 @@
                     //split
                     path = path.split(/\/+/);
                     var action = getAction(module, path[0]);
-                    if (typeof action == "function") {
+                    if (typeof action == "function" && path.length < action.length) {
                         // add remaining path elements as additional action arguments
                         var actionArgs = path.slice(1).map(decodeURIComponent);
                         var args = [req, res].concat(actionArgs);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.