struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeromy Evans <>
Subject i18n/TextProvider issues
Date Fri, 11 Apr 2008 05:48:51 GMT
I've been investigating some i18n issues in the 2.1.x branch and found 
that the search algorithm used by the Text tag differs from that of UIBean.
The Text tag iterates through the ValueStack looking for the first 
TextProvider and invokes getText(...) on the first found.
The UIBean executes the OGNL expression "getText(String)", which matches 
this method of the first TextProvider.

This works almost all the time, but I have two issues with it:
- the inconsistent search algorithm causes inconsistent behaviour when 
there's something unexpected in the stack 
- the OGNL expression is slow 
( and fragile 

I'm going to remove the hardcoded OGNL expressions from UIBean and Label 
and replace them with the same algorithm used by Text.  I would have 
proceeded without saying so but I also discovered that the TestAction 
used by the unit tests relies on getText being invoked directly by OGNL 
rather than its TextProvider implementation, so the consequences may be 
larger that I first imagined.

Please speak up if you see any potential issues.

Jeromy Evans

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message