Archives: 'Struts'

SCHAPPY — 3. Januar 2007, 4:02

Dynamic keys for Struts resources (i18n).

Problem: Status messages are returned via status codes (int) and localized messages should be retrieved via internationalized resource file in Struts directly in a JSP file (w/o touching a bean). Solution: Expression Language (EL) solves the problem elegant. Excerpt of the ApplicationResource.properties: [code lang=“Java“]overview.lifeCycleStatusCode=Lifecycle overview.lifecycleStatusCode.1= overview.lifecycleStatusCode.2=Withdrawn overview.lifecycleStatusCode.3=Sent overview.lifecycleStatusCode.4=Approved overview.lifecycleStatusCode.5=Rejected[/code] Excerpt of the according JSP file […]