Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Get only standard message resource values

Help
2004-10-28
2013-04-25
  • Michael Decker
    Michael Decker
    2004-10-28

    I'm using "MessageResources Impls" (http://sourceforge.net/project/showfiles.php?group_id=49385&package_id=76369) to get my message resources out of my database.... I've used this Instruction to install: http://wiki.apache.org/struts/StrutsMessageResourcesFromDatabase

    But now, i get only the default messages... if I set with setLocale(Locale.GERMAN) (at Action-Class), it doesn't change anything... I've testet some cases... Default value of getLocale() is de_DE, if I delete the default message in my db, so I get an exeption, that struts misses message....

    But if I use "normal" resource-files, it works!

    It's saved as:

    subApp       bundleKey       locale       msgKey       val
                      prompt.global.page_title     Default
                de     prompt.global.page_title     de
                de_DE     prompt.global.page_title     de_DE

    I've generated debug output... Perhaps that could be tell anybody anything:

    15:57:46,451 INFO  [STDOUT] [org.apache.ojb.broker.singlevm.PersistenceBrokerImpl] DEBUG:
    15:57:46,451 INFO  [STDOUT] getObjectByIdentity org.apache.struts.util.MessageResource{,,de_DE,prompt.global.page_title}
    15:57:46,471 INFO  [STDOUT] [org.apache.ojb.broker.accesslayer.SqlGenerator] DEBUG:
    15:57:46,471 INFO  [STDOUT] SQL: SELECT locale,val,msgKey,bundleKey,subApp FROM application_resources WHERE (application_resources.subApp = ? ) AND (application_resources.bundleKey = ? ) AND (application_resources.locale = ? ) AND (application_resources.msgKey = ? )
    15:57:46,651 INFO  [STDOUT] [org.apache.ojb.broker.singlevm.PersistenceBrokerImpl] DEBUG:
    15:57:46,651 INFO  [STDOUT] getObjectByIdentity org.apache.struts.util.MessageResource{,,,prompt.global.page_title}
    15:57:46,661 INFO  [PropertyMessageResources] Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
    15:57:46,681 INFO  [STDOUT] [org.apache.ojb.broker.singlevm.PersistenceBrokerImpl] DEBUG:
    15:57:46,681 INFO  [STDOUT] getObjectByIdentity org.apache.struts.util.MessageResource{,,de_DE,prompt.upload_sucess.submenu}
    15:57:46,681 INFO  [STDOUT] [org.apache.ojb.broker.singlevm.PersistenceBrokerImpl] DEBUG:
    15:57:46,681 INFO  [STDOUT] getObjectByIdentity org.apache.struts.util.MessageResource{,,,prompt.upload_sucess.submenu}

    I don't understand my fault...

    I thank you very Much!

    Mike