Weird! I just happened to notice that log behavior yesterday when I was
debugging. I had bigger fish to fry, though, so I didn't think about it
much. Thanks for the patch. I think a warning is the right way to go.
-Ben
Aaron Porter wrote:
Patch attached.
I'm not sure if this should log an error or warning so it's logging as
a warning right now.
I also noticed that using the Stripes Log util results in the wrong
line number getting displayed in the log. The line number in the log
corresponds to the line in Log instead of the line that called Log's
method. I'll see if anything can be done about that.
Aaron
Aaron Porter wrote:
Thanks Ben, I'll get on it.
Aaron
Ben Gunter wrote:
Hey, Aaron. I was waiting to see if anybody else would respond to
this. (Didn't mean to wait so long, though.) If you write the patch,
I'd be happy to commit it.
-Ben
Aaron Porter wrote:
I just spent a while figuring out why my field "test" wasn't
running through binding. It turned out that I wasn't thinking and
named my default handler test as well.
Could we get a warning or error message when the parameter which
specifies which handler to call has an associated value? It seems
like I've run into this same problem before.
I'd be happy to code up a patch.
Thanks!
Aaron
-------------------------------------------------------------------------
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
-------------------------------------------------------------------------
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
------------------------------------------------------------------------
Index:
/home/aporter/workspace/stripes/stripes/src/net/sourceforge/stripes/controller/DefaultActionBeanPropertyBinder.java
===================================================================
---
/home/aporter/workspace/stripes/stripes/src/net/sourceforge/stripes/controller/DefaultActionBeanPropertyBinder.java
(revision 476)
+++
/home/aporter/workspace/stripes/stripes/src/net/sourceforge/stripes/controller/DefaultActionBeanPropertyBinder.java
(working copy)
@@ -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
------------------------------------------------------------------------
-------------------------------------------------------------------------
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
-------------------------------------------------------------------------
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