You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "johana pin (JIRA)" <ji...@apache.org> on 2007/09/22 15:56:36 UTC

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

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: 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.


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

Posted by "johana pin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42283 ] 

johana pin  commented on WW-2199:
---------------------------------

First time I put this issue on user list. No answer.
Then, after 1 day, I put it on dev list. No answer.
After another day I put it on this issue list.

Even if it sound like a question it is a nice way to say that is a bug. Maybe I was not clear enough, but if you would read and test what I described you would noticed that the behaviour is not ok.

The problem that I see is that even the global properties files are loaded (tags are working), they can't be used in actions (when I used the message key) - this seams to me like a bug. 

And after the call in action of the method 'getText()',  the tag behaviour, in same request, is altered and it does not display the message any more, it will display the key of the message - this is another bug.

I also asked if there is another way to use the global messages in actions.

Is somethig wrong in what I said ? Or you did not understood the question ?

Thank you,


> 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: 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.


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

Posted by "Maxx (JIRA)" <ji...@apache.org>.
    [ 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.


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

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2199?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Holmes closed WW-2199.
----------------------------

    Resolution: Not A Problem

Questions like this should be asked on the Struts user's mailing list instead of opening a JIRA ticket. If you find that there is truly a bug in the Struts software, please open a JIRA ticket with specific details of the issue.

http://struts.apache.org/mail.html

> 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: 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.