You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Brian Repko (JIRA)" <ji...@apache.org> on 2008/08/19 22:41:25 UTC

[jira] Created: (WW-2774) default resource bundles don't load via TextProvider (they have to load via ResourceBundle.getBundle)

default resource bundles don't load via TextProvider (they have to load via ResourceBundle.getBundle)
-----------------------------------------------------------------------------------------------------

                 Key: WW-2774
                 URL: https://issues.apache.org/struts/browse/WW-2774
             Project: Struts 2
          Issue Type: Bug
          Components: Other
    Affects Versions: 2.0.11.2
            Reporter: Brian Repko


LocalizedTextUtil.findDefaultText calls LocalizedTextUtil.findResourceBundle directly in order to load ResourceBundles rather than going through TextProvider.getTexts.  By having defaults come from TextProvider we can implement ResourceBundles that come from Spring (MessageSource) or implement our own factories (including calling ResourceBundle.getBundle with a ResourceBundle.Control object on JDK6).

We have a database-based content management system that does not implement ResourceBundle but does implement MessageSource.  We plan to use the Spring classes to wrap MessageSource but cannot do so for default messages.  Our fallback is to name our MessageSources based on packages / classes and have nothing in the defaults except for xwork-messages.


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


[jira] Commented: (WW-2774) default resource bundles don't load via TextProvider (they have to load via ResourceBundle.getBundle)

Posted by "Lukasz Lenart (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=47241#action_47241 ] 

Lukasz Lenart commented on WW-2774:
-----------------------------------

I think the problem is related to bug in Xwork http://jira.opensymphony.com/browse/XW-572 which is already solved, please take a look on it and make a comment if it helps you.

Regards
--
Lukasz

> default resource bundles don't load via TextProvider (they have to load via ResourceBundle.getBundle)
> -----------------------------------------------------------------------------------------------------
>
>                 Key: WW-2774
>                 URL: https://issues.apache.org/struts/browse/WW-2774
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Other
>    Affects Versions: 2.0.11.2
>            Reporter: Brian Repko
>             Fix For: Future
>
>
> LocalizedTextUtil.findDefaultText calls LocalizedTextUtil.findResourceBundle directly in order to load ResourceBundles rather than going through TextProvider.getTexts.  By having defaults come from TextProvider we can implement ResourceBundles that come from Spring (MessageSource) or implement our own factories (including calling ResourceBundle.getBundle with a ResourceBundle.Control object on JDK6).
> We have a database-based content management system that does not implement ResourceBundle but does implement MessageSource.  We plan to use the Spring classes to wrap MessageSource but cannot do so for default messages.  Our fallback is to name our MessageSources based on packages / classes and have nothing in the defaults except for xwork-messages.

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


[jira] Commented: (WW-2774) default resource bundles don't load via TextProvider (they have to load via ResourceBundle.getBundle)

Posted by "Puneet Sachdev (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=47240#action_47240 ] 

Puneet Sachdev commented on WW-2774:
------------------------------------

Any update on a patch for this...we want the resource bundles to be loaded from a content management system using HTTP..?? 

> default resource bundles don't load via TextProvider (they have to load via ResourceBundle.getBundle)
> -----------------------------------------------------------------------------------------------------
>
>                 Key: WW-2774
>                 URL: https://issues.apache.org/struts/browse/WW-2774
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Other
>    Affects Versions: 2.0.11.2
>            Reporter: Brian Repko
>             Fix For: Future
>
>
> LocalizedTextUtil.findDefaultText calls LocalizedTextUtil.findResourceBundle directly in order to load ResourceBundles rather than going through TextProvider.getTexts.  By having defaults come from TextProvider we can implement ResourceBundles that come from Spring (MessageSource) or implement our own factories (including calling ResourceBundle.getBundle with a ResourceBundle.Control object on JDK6).
> We have a database-based content management system that does not implement ResourceBundle but does implement MessageSource.  We plan to use the Spring classes to wrap MessageSource but cannot do so for default messages.  Our fallback is to name our MessageSources based on packages / classes and have nothing in the defaults except for xwork-messages.

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


[jira] Updated: (WW-2774) default resource bundles don't load via TextProvider (they have to load via ResourceBundle.getBundle)

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

James Holmes updated WW-2774:
-----------------------------

    Fix Version/s: Future
       Issue Type: Improvement  (was: Bug)

I would consider this to be an improvement and not a bug.

Can you provide a patch? If so, we can get this integrated much faster.

> default resource bundles don't load via TextProvider (they have to load via ResourceBundle.getBundle)
> -----------------------------------------------------------------------------------------------------
>
>                 Key: WW-2774
>                 URL: https://issues.apache.org/struts/browse/WW-2774
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Other
>    Affects Versions: 2.0.11.2
>            Reporter: Brian Repko
>             Fix For: Future
>
>
> LocalizedTextUtil.findDefaultText calls LocalizedTextUtil.findResourceBundle directly in order to load ResourceBundles rather than going through TextProvider.getTexts.  By having defaults come from TextProvider we can implement ResourceBundles that come from Spring (MessageSource) or implement our own factories (including calling ResourceBundle.getBundle with a ResourceBundle.Control object on JDK6).
> We have a database-based content management system that does not implement ResourceBundle but does implement MessageSource.  We plan to use the Spring classes to wrap MessageSource but cannot do so for default messages.  Our fallback is to name our MessageSources based on packages / classes and have nothing in the defaults except for xwork-messages.

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


[jira] Commented: (WW-2774) default resource bundles don't load via TextProvider (they have to load via ResourceBundle.getBundle)

Posted by "Brian Repko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45312#action_45312 ] 

Brian Repko commented on WW-2774:
---------------------------------

The core problem is that TextProvider interface has 2 purposes - getting text and getting ResourceBundles.  Those need to be split.  In addition, there is no separation between the bundles loaded by default (xwork and struts2 messages) and the user defined messages.  This is not a simple "patch" - it requires some redesign.

I can see this being an improvement - but it should be clearly stated that in is current design Struts2 only works with properties file based ResourceBundles and does not support ResourceBundle.Control.  I can also see this as an improvement since, again, it requires some design/interface changes (really the whole i18n thing needs to be fixed quite a bit for Struts2).

We did get around this with a custom TextProvider but it was a total redesign and still had to call in to get xwork and struts2 messages.  A hack.

The reason that I consider this a bug is that Struts1 did this by defining MessageResources and MessageResourcesFactory interfaces. I know that Struts1 and Struts2 are not related but this is lost functionality.

> default resource bundles don't load via TextProvider (they have to load via ResourceBundle.getBundle)
> -----------------------------------------------------------------------------------------------------
>
>                 Key: WW-2774
>                 URL: https://issues.apache.org/struts/browse/WW-2774
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Other
>    Affects Versions: 2.0.11.2
>            Reporter: Brian Repko
>             Fix For: Future
>
>
> LocalizedTextUtil.findDefaultText calls LocalizedTextUtil.findResourceBundle directly in order to load ResourceBundles rather than going through TextProvider.getTexts.  By having defaults come from TextProvider we can implement ResourceBundles that come from Spring (MessageSource) or implement our own factories (including calling ResourceBundle.getBundle with a ResourceBundle.Control object on JDK6).
> We have a database-based content management system that does not implement ResourceBundle but does implement MessageSource.  We plan to use the Spring classes to wrap MessageSource but cannot do so for default messages.  Our fallback is to name our MessageSources based on packages / classes and have nothing in the defaults except for xwork-messages.

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