[Opensource] MessageBundle for a given schema?
larry hamel
expresso at codeguild.com
Sat Jul 13 11:23:17 PDT 2002
hi,
below is an old post by Daryl about MessageBundles outside of the Expresso schema.
I'm having the same problem with 4.1ea-2 code.
Was there some advice about this? Only the Expresso message bundle is accessed, as far as we can tell, for DB object descriptions.
thanks,
larry
>Date: Fri, 5 Apr 2002 14:10:09 -0800 (GMT-08:00)
>From: support at jcorporate.com
>To: jcorporate at codeguild.com
>Subject: [Expresso Users:How does Expresso determine the active schema object?] How does Expresso determine the active schema object?
>
>Message posted by user 'daryl-olson' at 2002-04-05 13:52:38
>
>First here's some background information:
>
>In order to learn Expresso, I have built a little example, registered my schema and then ran the "Create/Verify Database Structure & Perform Initial Setup". After this it works as expected.
>
>The application only has three objects: intro.IntroSchema, intro.dbobj.Company and intro.controller.CompanyController. In IntroSchema, I add the Controller and DBObject as follows:
>
> addDBObject("intro.dbobj.Company");
> addController("intro.controller.CompanyController");
>
>Next I wanted to try to get the internationalization working. I wanted to my application to use it's own MessageBundle.properties files. In IntroSchema, I have added an implementation for getMessageBundlePath() as:
>
> return ("intro");
>
>To test the internationalization, I added the following code in CompanyController for runPromptAddCompanyState(...):
>
> log.debug(getSchema());
> response.setTitle(response.getString("title.CompanyMaintenance"));
>
>and added the following to the MessageBundle.properties in .../WEB-INF/classes/intro/
>
> title.CompanyMaintenance=Company Maintenance
>
>Now the problem. When I run the application and select to run the "promptAddCompany" state, I get an exception:
>
> "Nested exception message:No such key 'title.CompanyMaintenance' in bundle at 'com/jcorporate/expresso/core'".
>
>The "log.debug(getSchema())" call reveals (as indicated by the exception), that Company's schema is set to "com.jcorporate.expresso.core.ExpressoSchema". I have also check and the contructor for IntroSchema is never
>called.
>
>I realize that if I added the "title.CompanyMaintenance" mapping to the Expresso MessageBundle that I would not have this problem.
>
>My questions are:
>
>1) Why is the IntroSchema constructor never called?
>
>2) How is Expresso suppose to know that when I type http://localhost:8080/expresso/expresso-intro/index.jsp that the application schema object that is suppose to be associated with that URL is (or suppose to be) IntroSchema?
>
>3) What is the proper way to associate the IntroSchema with CompanyController? I don't want to code setSchema("intro.IntroSchema") in the CompanyController (high coupling; what if I want to use it with another schema?). If IntroSchema's constructor was being called, would the "addController("intro.controller.CompanyController")"
>call take care of this?
>
>Any insight would be appreciated.
>
>Thanks,
>Daryl
>
>
>
>
>Reply to this message: http://www.jcorporate.com:80/eforum/Browse.do?state=promptReply&MessageId=3003
>
>Browse Thread: http://www.jcorporate.com:80/eforum/Browse.do?state=browseMessages&ThreadId=677&GroupId=1
>
>You are receiving this email because you are subscribed to an eForum discussion group at www.jcorporate.com. If you want to change your subscription, use this link: http://www.jcorporate.com:80/eforum/Browse.do?state=promptGroupSubscribe. You must be logged in (or have a cookie stored from a previous login) to use this link. You can login here: http://www.jcorporate.com:80/Login.do
More information about the Opensource
mailing list