AW: AW: Struts 2 requires input result on failed type conversion
Since nobody was able to help me so far I tried to dive into the matter myself. To this point in time I was not able to understand how Struts type conversion works though. Especially I was not able to find the spot in the code where Struts returns the "input" result-string on a failed validation since this is where my problem lies. I want to prevent this from happening, but have no idea how to achieve it. Nobody around who has an idea on how to solve my problem? -Ursprüngliche Nachricht- Von: Ing. Andrea Vettori [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 11. Juli 2007 19:00 An: Struts Users Mailing List Betreff: Re: AW: Struts 2 requires input result on failed type conversion I haven't tried but it seems possibile http://struts.apache.org/2.0.8/docs/type-conversion.html Il giorno 11/lug/07, alle ore 18:55, Martin Simons ha scritto: > Well, the app has grown for quite some time now and consists of a > lot of > actions. Touching all of the them and exchanging all number-setters > with > some kind of string parsing would be a whole lot of work. > So my favourite solution would be something that easily achieved by > struts > default functionality. After all, this problem doesn't seem too > exotic :) > > > -Ursprüngliche Nachricht- > Von: Ing. Andrea Vettori [mailto:[EMAIL PROTECTED] > Gesendet: Mittwoch, 11. Juli 2007 18:47 > An: Struts Users Mailing List > Betreff: Re: Struts 2 requires input result on failed type conversion > > it's not what you want but why don't use String getter/setter on the > action and do the conversion later ? > > Il giorno 11/lug/07, alle ore 18:37, Martin Simons ha scritto: > >> Hi everybody, this is my first mailing list :-) >> >> I'm currently developing a web-app based on Struts 2. My visitors >> are mainly >> German and whenever they enter numbers, they usually type a decimal >> number >> like 1,23 instead of 1.23. If the setter of the action requires a >> double, >> type conversion will fail and ask for an "input" result. For historic >> reasons this doesn't exist in my application. Input errors are >> handled >> separately and if type conversion fails, null or 0 is expected. How >> can I >> get Struts to use this behaviour, or even better, cast a comma- >> separated >> decimal to a double correctly. >> >> Thanks for your help, >> Martin >> >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > > -- > Ing. Andrea Vettori > Consulente per l'Information Technology > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Ing. Andrea Vettori Consulente per l'Information Technology - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: AW: Struts 2 requires input result on failed type conversion
If it isn't easily possible to change the conversion behaviour, is it at least possible to keep Struts from redirecting to the "input" result? This would probably cause the relevant fields to stay 0 or null anyways and would solve my problem more or less. -Ursprüngliche Nachricht- Von: Ing. Andrea Vettori [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 11. Juli 2007 19:00 An: Struts Users Mailing List Betreff: Re: AW: Struts 2 requires input result on failed type conversion I haven't tried but it seems possibile http://struts.apache.org/2.0.8/docs/type-conversion.html Il giorno 11/lug/07, alle ore 18:55, Martin Simons ha scritto: > Well, the app has grown for quite some time now and consists of a > lot of > actions. Touching all of the them and exchanging all number-setters > with > some kind of string parsing would be a whole lot of work. > So my favourite solution would be something that easily achieved by > struts > default functionality. After all, this problem doesn't seem too > exotic :) > > > -Ursprüngliche Nachricht- > Von: Ing. Andrea Vettori [mailto:[EMAIL PROTECTED] > Gesendet: Mittwoch, 11. Juli 2007 18:47 > An: Struts Users Mailing List > Betreff: Re: Struts 2 requires input result on failed type conversion > > it's not what you want but why don't use String getter/setter on the > action and do the conversion later ? > > Il giorno 11/lug/07, alle ore 18:37, Martin Simons ha scritto: > >> Hi everybody, this is my first mailing list :-) >> >> I'm currently developing a web-app based on Struts 2. My visitors >> are mainly >> German and whenever they enter numbers, they usually type a decimal >> number >> like 1,23 instead of 1.23. If the setter of the action requires a >> double, >> type conversion will fail and ask for an "input" result. For historic >> reasons this doesn't exist in my application. Input errors are >> handled >> separately and if type conversion fails, null or 0 is expected. How >> can I >> get Struts to use this behaviour, or even better, cast a comma- >> separated >> decimal to a double correctly. >> >> Thanks for your help, >> Martin >> >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > > -- > Ing. Andrea Vettori > Consulente per l'Information Technology > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Ing. Andrea Vettori Consulente per l'Information Technology - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: AW: Struts 2 requires input result on failed type conversion
There definitely isn't an easier way to do it? I simply can't image that such a basic problem hasn't been solved already with a standard procedure since it is, in my eyes, a fundamental localization issue :-) -Ursprüngliche Nachricht- Von: Ing. Andrea Vettori [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 11. Juli 2007 19:00 An: Struts Users Mailing List Betreff: Re: AW: Struts 2 requires input result on failed type conversion I haven't tried but it seems possibile http://struts.apache.org/2.0.8/docs/type-conversion.html Il giorno 11/lug/07, alle ore 18:55, Martin Simons ha scritto: > Well, the app has grown for quite some time now and consists of a > lot of > actions. Touching all of the them and exchanging all number-setters > with > some kind of string parsing would be a whole lot of work. > So my favourite solution would be something that easily achieved by > struts > default functionality. After all, this problem doesn't seem too > exotic :) > > > -Ursprüngliche Nachricht- > Von: Ing. Andrea Vettori [mailto:[EMAIL PROTECTED] > Gesendet: Mittwoch, 11. Juli 2007 18:47 > An: Struts Users Mailing List > Betreff: Re: Struts 2 requires input result on failed type conversion > > it's not what you want but why don't use String getter/setter on the > action and do the conversion later ? > > Il giorno 11/lug/07, alle ore 18:37, Martin Simons ha scritto: > >> Hi everybody, this is my first mailing list :-) >> >> I'm currently developing a web-app based on Struts 2. My visitors >> are mainly >> German and whenever they enter numbers, they usually type a decimal >> number >> like 1,23 instead of 1.23. If the setter of the action requires a >> double, >> type conversion will fail and ask for an "input" result. For historic >> reasons this doesn't exist in my application. Input errors are >> handled >> separately and if type conversion fails, null or 0 is expected. How >> can I >> get Struts to use this behaviour, or even better, cast a comma- >> separated >> decimal to a double correctly. >> >> Thanks for your help, >> Martin >> >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > > -- > Ing. Andrea Vettori > Consulente per l'Information Technology > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Ing. Andrea Vettori Consulente per l'Information Technology - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: Struts 2 requires input result on failed type conversion
I haven't tried but it seems possibile http://struts.apache.org/2.0.8/docs/type-conversion.html Il giorno 11/lug/07, alle ore 18:55, Martin Simons ha scritto: Well, the app has grown for quite some time now and consists of a lot of actions. Touching all of the them and exchanging all number-setters with some kind of string parsing would be a whole lot of work. So my favourite solution would be something that easily achieved by struts default functionality. After all, this problem doesn't seem too exotic :) -Ursprüngliche Nachricht- Von: Ing. Andrea Vettori [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 11. Juli 2007 18:47 An: Struts Users Mailing List Betreff: Re: Struts 2 requires input result on failed type conversion it's not what you want but why don't use String getter/setter on the action and do the conversion later ? Il giorno 11/lug/07, alle ore 18:37, Martin Simons ha scritto: Hi everybody, this is my first mailing list :-) I'm currently developing a web-app based on Struts 2. My visitors are mainly German and whenever they enter numbers, they usually type a decimal number like 1,23 instead of 1.23. If the setter of the action requires a double, type conversion will fail and ask for an "input" result. For historic reasons this doesn't exist in my application. Input errors are handled separately and if type conversion fails, null or 0 is expected. How can I get Struts to use this behaviour, or even better, cast a comma- separated decimal to a double correctly. Thanks for your help, Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ing. Andrea Vettori Consulente per l'Information Technology - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ing. Andrea Vettori Consulente per l'Information Technology - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Struts 2 requires input result on failed type conversion
Well, the app has grown for quite some time now and consists of a lot of actions. Touching all of the them and exchanging all number-setters with some kind of string parsing would be a whole lot of work. So my favourite solution would be something that easily achieved by struts default functionality. After all, this problem doesn't seem too exotic :) -Ursprüngliche Nachricht- Von: Ing. Andrea Vettori [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 11. Juli 2007 18:47 An: Struts Users Mailing List Betreff: Re: Struts 2 requires input result on failed type conversion it's not what you want but why don't use String getter/setter on the action and do the conversion later ? Il giorno 11/lug/07, alle ore 18:37, Martin Simons ha scritto: > Hi everybody, this is my first mailing list :-) > > I'm currently developing a web-app based on Struts 2. My visitors > are mainly > German and whenever they enter numbers, they usually type a decimal > number > like 1,23 instead of 1.23. If the setter of the action requires a > double, > type conversion will fail and ask for an "input" result. For historic > reasons this doesn't exist in my application. Input errors are handled > separately and if type conversion fails, null or 0 is expected. How > can I > get Struts to use this behaviour, or even better, cast a comma- > separated > decimal to a double correctly. > > Thanks for your help, > Martin > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Ing. Andrea Vettori Consulente per l'Information Technology - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 requires input result on failed type conversion
it's not what you want but why don't use String getter/setter on the action and do the conversion later ? Il giorno 11/lug/07, alle ore 18:37, Martin Simons ha scritto: Hi everybody, this is my first mailing list :-) I'm currently developing a web-app based on Struts 2. My visitors are mainly German and whenever they enter numbers, they usually type a decimal number like 1,23 instead of 1.23. If the setter of the action requires a double, type conversion will fail and ask for an "input" result. For historic reasons this doesn't exist in my application. Input errors are handled separately and if type conversion fails, null or 0 is expected. How can I get Struts to use this behaviour, or even better, cast a comma- separated decimal to a double correctly. Thanks for your help, Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ing. Andrea Vettori Consulente per l'Information Technology - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 2 requires input result on failed type conversion
Hi everybody, this is my first mailing list :-) I'm currently developing a web-app based on Struts 2. My visitors are mainly German and whenever they enter numbers, they usually type a decimal number like 1,23 instead of 1.23. If the setter of the action requires a double, type conversion will fail and ask for an "input" result. For historic reasons this doesn't exist in my application. Input errors are handled separately and if type conversion fails, null or 0 is expected. How can I get Struts to use this behaviour, or even better, cast a comma-separated decimal to a double correctly. Thanks for your help, Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]