🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.computers.java
Article #32

Struts: Localition with "MessageResources Impls": Get only standard message resource values

#32
From: Michael Decker
Date: Mon, 25 Oct 2004 06:38
53 lines
3097 bytes
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....

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
Technical Details
Message-ID: <2u3lb4F23m093U2@uni-berlin.de>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10d6db,c79b1c7ce4955670,start
X-Google-Attributes: gid10d6db,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail
From: Michael Decker <ThReCa@Web.de>
Newsgroups: aus.computers.java
Subject: Struts: Localition with "MessageResources Impls": Get only standard
 message resource values
Date: Mon, 25 Oct 2004 08:38:27 +0200
Lines: 53
Message-ID: <2u3lb4F23m093U2@uni-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de mOENJk9oxoNcb7FNIfFQVANTIsYmi8J+pq6uSlEhi0T0tjSTA=
User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913)
X-Accept-Language: en-us, en