Really I was using a custom type
converter (with annotations on getters & setters) but I had
the problem that when typeconversionexception was thrown the
dynamic contents on my web page (objects retrieved from db or from
actions) didn't display.
Really I don't know what the problem was, i suspect something with interceptors, maybe paramters interceptor wasn't able to retrieve passed parameters, but it's just a theory. Alessio
Matteo Thank you so much, I solved the special characters problems by setting the struts i18n constant to ISO-8859-1! About the conversion error, I know it was a dev mode warning, but when the exception was thrown every dynamic content in my page disappeard... Anyway I solved the issue by declaring every action attribute as a string and using specific regex xml validators to deny invalid inputs. Then, in the action, I use parser and other utility methods to convert the attributes to their correct formats.RegardsInstead of using strings as action members I would suggest to use custom TypeConverters: https://struts.apache.org/release/2.0.x/docs/type-conversion.html Note there is a TypeConversion annotation, too. That can be used to annotate action getters/setters. Regards, Christoph This Email was scanned by Sophos Anti Virus |
- Re: Problems with type conversion and special characters Alessio Matteo
- Antwort: Re: Problems with type conversion and spec... Christoph Nenning
- Re: Antwort: Re: Problems with type conversion ... Alessio Matteo