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/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 :
> 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
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
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 {
>
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
6 matches
Mail list logo