I'll add this code as an additional example, but I'm wondering is it a
good way to base on fieldErrors as they can be also populated by
validators.
Maybe adding ConversionAware interface with specific method to
populate conversionErrors would be better ?
Then I could extend ActionSupport with getF
This works nicely.
Thanks!
Cheers,
J.
On Thu, May 31, 2012 at 3:07 PM, Łukasz Lenart wrote:
> Can be reduced to this:
>
> public String getFormatted(String key, String fieldName, List args) {
> if (getFieldErrors().isEmpty()) {
> return getText(key, args);
> } else {
>
Can be reduced to this:
public String getFormatted(String key, String fieldName, List args) {
if (getFieldErrors().isEmpty()) {
return getText(key, args);
} else {
return
ActionContext.getContext().getValueStack().findString(defaultValue);
}
}
and it wor
2012/5/31 J. Garcia :
> The short-circuiting option sounds good. There could even be a specially
> dedicated getText() (or alternative method name) for this scenario, which
> should be rather frequent in l10n apps.
Not the best solution, but works:
and in ExampleAction (or any other base action
2012/5/31 Łukasz Lenart :
> Ok, looks like a problem is with getText() in jsp but I think there is
> no other way ... you can use String instead and check for errors in
> getter/setter but I'm not sure if it does the trick
The problem is a bit complicated here as getText(String key, String[]
args)
2012/5/31 J. Garcia :
> Ok. Sorry.
> Fixed the example to match the real situation. Prepare() will only execute
> now if the request is a get method.
Ok, looks like a problem is with getText() in jsp but I think there is
no other way ... you can use String instead and check for errors in
getter/se
2012/5/29 J. Garcia :
> Attached an example, generated from struts2 archetype and modified to
> reproduce the situation.
>
> - run with mvn jetty:run. I use maven 2.2.1.
> - on browser, type: localhost:8080/struts-test/example/Login
> - you'll see a form, with formatted integer.
> - modify the inte
2012/5/29 J. Garcia :
> Integer.
Strange, should work. Could you post an example code ?
Regards
--
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/
-
To unsubscri
Integer.
On Mon, May 28, 2012 at 10:04 AM, Łukasz Lenart <
lukasz.len...@googlemail.com> wrote:
> Is it int either Integer ?
>
>
> Regards
> --
> Łukasz
> mobile +48 606 323 122 http://www.lenart.org.pl/
> Warszawa JUG conference - Confitura http://confitura.pl/
>
Is it int either Integer ?
Regards
--
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/
-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional
Thanks Lukasz for your reply.
While preparing a minimal example, I got the reason of it all.
The real situation is:
- The input form has an int field
- The value already available should be formatted and localized: 43,000 /
43.000
- In order to achive l10n, the input field tag is like this:
Could you add some code example ?
Regards
--
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/
-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For addi
Hi,
In order to implement a good user experience, I am trying to put into
practice the conversion validator, as documented here:
http://struts.apache.org/2.3.3/docs/conversion-validator.html
The ideal would be: a form with one integer field. If the user enters a non
valid integer, the value rema
13 matches
Mail list logo