DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34291>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34291





------- Additional Comments From [EMAIL PROTECTED]  2005-04-05 10:38 -------
see related bug in firefox https://bugzilla.mozilla.org/show_bug.cgi?id=289060
and RFE Bug 34297 (to gracefully handle the transition in struts-based
web-applications until all browsers do use the charset) 

I order to be able to work with the existing struts.jar, on solution might be
1) create a UtilForm class that extends the ActionForm
2) the forms used in the application are an extension of this UtilForm
3) change method signature of validate to include the class itself
4) in UtilForm iterate through the fields of the calling class and do the
character encoding conversion of all string fields along the lines of

Field[] fields = callingForm.getClass().getDeclaredFields();
                    for (int i = 0; i < fields.length; i++) {
                        Field field = fields[i];
                        field.setAccessible(true);
                        Object obj = new Object();
                        try {
                            obj = field.getType();
                            if (field.toString().indexOf("String") != -1) {
                                String methodName = "get"
                                        + field.getName().substring(0, 1)
                                                .toUpperCase()
                                        + field.getName().substring(1);
                                Method getter = callingForm.getClass()
                                        .getMethod(methodName, new Class[] {});
...
//now use that method to get the content of the field and in a similar way,
// write back the altered form with the correspondingly retrieved setter method
// only then, call super.validate(mapping, request);

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to