commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 34291] - allow to change default string charset encoding to other than ISO-8859
Date Tue, 05 Apr 2005 08:38:40 GMT
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 hauser@acm.org  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 the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message