Hi!

I posted a problem about not beeing able to differentiate between
multiple <html:image>-tags in the form bean.

While I am not sure I have understand the whole problem I found a
solution that works for me (and maybe for others too).

I modified org.apache.struts.util.BeanUtils.java:

-------------------------------------------------------------------
--- RequestUtils.java   Tue Sep 18 15:07:33 2001
+++ RequestUtils.java.unmodified        Tue Sep 18 15:06:25 2001
@@ -759,14 +759,6 @@
                 stripped =
                     stripped.substring(0, stripped.length() - suffix.length());
             }
-
-           if (stripped.endsWith(".x")) {
-                   stripped = stripped.substring(0, stripped.length() - 2) + "X";
-           }
-           if (stripped.endsWith(".y")) {
-                   stripped = stripped.substring(0, stripped.length() - 2) + "Y";
-           }
-
             if (isMultipart) {
                 properties.put(stripped, multipartElements.get(name));
             }

-------------------------------------------------------------------


This renames parameters like: submit.x to submitX and submit.y to
submitY. This preserves the information, which button has been hit
and where.

The methods in the form are setSubmitX and setSubmitY.

I'd prefer a call to setSubmit(String[] paramValue) submitting
the x-value in paramValue[0] and the y-value in paramValue[1]. If
it doesn't matter where the button has been hit setSubmit(String
paramValue) (or even better setSubmit()) should be enough. But IMHO
this has to be done in different Classes which are right now moving
targets. We are still at 1.0 and will switch not before 1.1 is
released.

Regards,
        Dirk

Reply via email to