You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Maxx (JIRA)" <ji...@apache.org> on 2007/12/18 12:44:34 UTC

[jira] Commented: (WW-2199) can't set action error text from global resource file

    [ https://issues.apache.org/struts/browse/WW-2199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42826 ] 

Maxx commented on WW-2199:
--------------------------

I also use global messages for actionError/actionMessage in actions, but do not have this issue.

Effectively my case is slightly different:
I use the flat properties file "struts.properties" including the key struts.custom.i18n.resources=... (replace ... by your value, e.g. ApplicationResources) placed directly at the top of the package trees of my application, alongside the global messages file, e.g.

/com/firm/app/action/MyAction.java
/struts.properties
/GlobalMessages.properties

> can't set action error text from global resource file
> -----------------------------------------------------
>
>                 Key: WW-2199
>                 URL: https://issues.apache.org/struts/browse/WW-2199
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.0.9
>         Environment: windows, websphere 6.0, java 1.4. - struts 2.0.9 J4 distribution + spring
>            Reporter: johana pin 
>
> How can I use a global resource properties file (defined in struts..xml as:
> <constant name="struts.custom.i18n.resources" value="ApplicationResources"/>
> ) for setting an action error text in an action class having an error key ?
> I tried in action class: addActionError(getText("error.business.norights")), but the problem is that the text is not found and the key is returned.
> When I use only in jsp: <s:text name="error.business.norights" /> the text is found - the output is ok.
> When I use in the action the call: 'getText("error.business.norights")' the key is returned and after that in jsp the s: text tag does not output the value of the key anymore. The output is the key: 'error.business.norights'.
> Is this a bug or is there a way to do this ?
> Thank you,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.