History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: WW-1390
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: tm_jee
Reporter: Mark Chaimungkalanont
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
WebWork

Adding hasKey to the TextProvider interface

Created: 04/Dec/06 03:02 AM   Updated: 23/Dec/06 08:57 AM
Component/s: Actions
Affects Version/s: 2.2.4
Fix Version/s: 2.2.5


 Description  « Hide
I'm trying to a write a method which returns true if a key exists in a resource bundle (as used by the TextProvider). At the moment, I have something along the lines of:

public boolean doesTextKeyExist(String labelKey)
{
String s = getText(labelKey);
return s != null && !s.equals(labelKey);
}

which works fine. But it does have some annoying logging like:

WARN [LocalizedTextUtil:424] Unable to find text for key 'export.js.title.description' in 'class com.atlassian.bamboo.ww2.actions.build.admin.config.ConfigureBuildPostAction' and locale 'en_US'

I could turn off logging to for this class to hide this, but it would be nice if the TextProvider interface had something along the lines of:

boolean hasKey(String key);

that does this a bit nicer.

See http://forums.opensymphony.com/thread.jspa?forumID=1&threadID=51663 for more discussions

 All   Comments   Change History      Sort Order:
tm_jee - [23/Dec/06 08:56 AM ]
fixed.

Sending src/java/com/opensymphony/xwork/ActionSupport.java
Sending src/java/com/opensymphony/xwork/DefaultTextProvider.java
Sending src/java/com/opensymphony/xwork/TextProvider.java
Sending src/java/com/opensymphony/xwork/TextProviderSupport.java
Sending src/java/com/opensymphony/xwork/util/LocalizedTextUtil.java
Sending src/java/com/opensymphony/xwork/validator/DelegatingValidatorContext.java
Sending src/test/com/opensymphony/xwork/TextProviderSupportTest.java
Sending src/test/com/opensymphony/xwork/util/LocalizedTextUtilTest.java
Transmitting file data ........
Committed revision 1280.

Pls kindly review. Thx