struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandeep Takhar <sandeep_tak...@yahoo.com>
Subject RE: Multiple Application Modules
Date Thu, 10 Jul 2003 21:39:10 GMT
in struts-config and for module b you have defined
that its key="test"?

I think that this is a yes.

sandeep
--- Lloyd Wilson <Lloyd.Wilson@pwgsc.gc.ca> wrote:
> How would I retrieve values from my message resource
> bundle without a key??
> 
> Currently, I use the following to access a message
> resource bundle for a given JSP page. For ie. If I
> want to access the message resource key "index" from
> the default struts config file I do the following in
> my JSP page:
> 
> Assume "index.jsp" for moduleA. (moduleA being the
> default "/")
> 
> ...
> <title>
>   <bean:message bundle="index" key="page.title" />
> </tilte>
> ... 
> 
> This snippet of code will look at the "index"
> message resource bundle defined in the default
> struts config file and get the key "page.title".
> This displays the title for that page. Within the
> same page in the body I have a link to the module b
> test page like so:
> 
> <html:link forward="moduleb">ModuleB</html:link>
> 
> When the page renders, the forward "moduleb" becomes
> "/moduleb/test.jsp" for example which is defined as
> a forward within the default struts config file.
> 
> When the user clicks on the link, the switch occurs
> to the module b struts config file no problem and
> renders the page appropriately. The ONLY problem I
> have is defining the message resource bundle within
> the module b struts config file. Let's say for
> clarity I have within the test.jsp for module b the
> following code:
> 
> ...
> <title>
>   <bean:message bundle="test" key="page.title" />
> </tilte>
> ... 
> 
> If I attempt to render this page with the following
> code and the message resource bundle configured in
> the struts config file for module b it will NOT
> work. The only way it will work properly is if it's
> defined in the default struts config file (module
> a). I do have a workaround which is to define all
> the message resource bundles in the default struts
> config file, but I JUST want to know if this appears
> to be a problem that I am only having or if this
> should be reported as a bug?
> 
> I'm not sure how to better clarify my problem. I
> hope the above helps.
> 
> Cheers,
> Lloyd
> 
> 
> -----Original Message-----
> From: James Mitchell [mailto:jmitchell@apache.org]
> Sent: Thursday, July 10, 2003 12:50 PM
> To: Struts Users Mailing List
> Subject: Re: Multiple Application Modules
> 
> 
> ----- Original Message -----
> From: "James Mitchell" <jmitchell@apache.org>
> To: "Struts Users Mailing List"
> <struts-user@jakarta.apache.org>
> Sent: Thursday, July 10, 2003 12:42 PM
> Subject: Re: Multiple Application Modules
> 
> 
> > > ----- Original Message -----
> > > From: "Lloyd Wilson" <Lloyd.Wilson@pwgsc.gc.ca>
> > > To: "Struts Users Mailing List"
> <struts-user@jakarta.apache.org>
> > > Sent: Thursday, July 10, 2003 12:24 PM
> > > Subject: RE: Multiple Application Modules
> > >
> > >
> > > The message resource settings only occur in the
> default struts config
> file
> > as I can't pick up the message resources from the
> other struts config
> > modules.
> > >
> > > Here is what i'm trying to do:
> > >
> > > Module A (default struts config)
> > >
> > >   <message-resources
> > >     key="index"
> > >     parameter="resources.Index"
> > >     null="false" />
> > >
> > > Module B
> > >
> > >   <message-resources
> > >     key="test"
> > >     parameter="resources.moduleB.Test"
> > >     null="false" />
> > >
> > > For some reason I cannot use the "test" message
> resource bundle
> > > when viewing a page from ModuleB unless I have
> defined it in ModuleA.
> > >
> > > Does that help at all?
> > >
> >
> > Not really.  Typically, you wouldn't need to
> specify a key for "Module B"
> > (unless you
> > just want to).
> 
> Sorry, meant to say that you don't need to specify a
> key for any Module
> unless you have more than one FOR THAT Module.
> 
> >
> > When accessing a message from an action of a jsp,
> Struts should have
> already
> > "switched" modules.
> >
> > How are your users navigating to and from the
> different Modules?
> >
> >
> > --
> > James Mitchell
> > Software Developer/Struts Evangelist
> > http://www.struts-atlanta.org
> > 678-910-8017
> > AIM:jmitchtx
> >
> 
> 
> --
> James Mitchell
> Software Developer/Struts Evangelist
> http://www.struts-atlanta.org
> 678-910-8017
> AIM:jmitchtx
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message