Revision: 477
          http://svn.sourceforge.net/stripes/?rev=477&view=rev
Author:   bengunter
Date:     2007-03-03 19:32:12 -0800 (Sat, 03 Mar 2007)

Log Message:
-----------
Log a warning when an attempt is made to bind a property
whose name is the same as the event

Modified Paths:
--------------
    
trunk/stripes/src/net/sourceforge/stripes/controller/DefaultActionBeanPropertyBinder.java

Modified: 
trunk/stripes/src/net/sourceforge/stripes/controller/DefaultActionBeanPropertyBinder.java
===================================================================
--- 
trunk/stripes/src/net/sourceforge/stripes/controller/DefaultActionBeanPropertyBinder.java
   2007-01-09 03:26:18 UTC (rev 476)
+++ 
trunk/stripes/src/net/sourceforge/stripes/controller/DefaultActionBeanPropertyBinder.java
   2007-03-04 03:32:12 UTC (rev 477)
@@ -189,9 +189,19 @@
 
             try {
                 String pname = name.getName(); // exact name of the param in 
the request
+                
+                if (pname.equals(context.getEventName())) {
+                    String[] values = entry.getValue();
+                    if ((values != null) && ((values.length > 1) || 
(values[0].length() > 0))) {
+                        log.warn("Attempting to bind ", values.length, " 
value",
+                                 values.length != 1 ? "s" : "",
+                                 " to a property with the same name as the 
event (", pname, ")");
+                    }
+                    continue;
+                }
 
                 if (!StripesConstants.SPECIAL_URL_KEYS.contains(pname)
-                        && !pname.equals(context.getEventName()) && 
!fieldErrors.containsKey(pname)) {
+                        && !fieldErrors.containsKey(pname)) {
                     log.trace("Running binding for property with name: ", 
name);
 
                     // Determine the target type


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to