struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Łukasz Lenart <lukasz.len...@googlemail.com>
Subject Re: conversion error repopulation not working
Date Thu, 31 May 2012 11:48:32 GMT
2012/5/31 Łukasz Lenart <lukasz.lenart@googlemail.com>:
> 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) accepts only strings, so getText("format.number", {user.born})
is converted to call getText("{0,number,#,##0.#}", String[]{"1980"}) -
notice that all params are Strings - and then MessageFormat throws
exception as it cannot format String as a Number.

Right now I don't see any bright solution, I think there should be a
short-circuit when conversion error occurs to  skip evaluating
getText() expression and just return what was specified as a key /
name property.


Regards
-- 
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message