tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Evgeny Gesin <evgenyge...@yahoo.com>
Subject Re: ApplicationResources.properties - resolution
Date Thu, 22 Jan 2004 14:02:44 GMT
That's can be interesting discussion, what Naming
Convention people use to name "keys" in
bundle.properties file to unique identify text
elements in JSP pages

key1=bla-bla1
key2=bla-bla2

Evgeny Gesin
Javadesk CEO / Founder


--- Kris Schneider <kris@dotech.com> wrote:
> Which is a good argument for making your bundle
> basenames unique:
> 
> com.cyberspaceroad.jaas.ApplicationResources
> com.cyberspaceroad.app1.ApplicationResources
> com.cyberspaceroad.app2.ApplicationResources
> ...
> 
> For a web app, the property files would reside in
>
WEB-INF/classes/com/cyberspaceroad/app1/ApplicationResources.properties
> 
> Quoting Evgeny Gesin <evgenygesin@yahoo.com>:
> 
> > Great!
> > That's because first .properties file found in
> > classpath is used.
> > 
> > Evgeny Gesin
> > Javadesk CEO / Founder
> > 
> > 
> > --- Adam Hardy <ahardy.struts@cyberspaceroad.com>
> > wrote:
> > > OK, after I figured out how to grep through the
> > > content of all the jar 
> > > files I could find, it turned up.
> > > 
> > > I had programmed a JAAS login module, placed it
> in 
> > > CATALINA_HOME/common/lib, using
> > > ApplicationResources.properties (i.e. 
> > > the same class name that I specified in the
> app's
> > > web.xml under 
> > > javax.servlet.jsp.jstl.fmt.localizationContext),
> and
> > > using the same 
> > > strings (e.g. app.title).
> > > 
> > > So JSTL fmt had picked up the
> > > ApplicationResources.properties class from 
> > > the jar in commons/lib, well actually the
> > > ...._de.properties, and used 
> > > that in my app. And it would presumably have
> used it
> > > in all apps that 
> > > specified ApplicationResources as the resource
> > > bundle name.
> > > 
> > > Perhaps this could be considered
> counter-intuitive
> > > behaviour? I'm not 
> > > sure. But I think the behaviour should be
> defined at
> > > the next round of 
> > > spec. writing.
> > > 
> > > Whatever, I'm happy now. :)
> > > 
> > > On 01/21/2004 08:47 PM Evgeny Gesin wrote:
> > > > Adam,
> > > > this situation is not obvious. I suggest to
> run a
> > > > search command over all* files to look for a
> > > specific
> > > > DE text which you see on the screen. That can
> give
> > > you
> > > > some ideas what happen at run-time.
> > > > 
> > > > Evgeny Gesin
> > > > Javadesk CEO / Founder
> > > > 
> > > > --- Adam Hardy
> <ahardy.struts@cyberspaceroad.com>
> > > > wrote:
> > > > 
> > > >>Yes. Searched for all *.properties files in
> tomcat
> > > >>and in them for the 
> > > >>offending strings, but to no avail. I'll try
> again
> > > >>though just to make sure.
> > > >>
> > > >>On 01/21/2004 03:21 PM Sgarlata Matt wrote:
> > > >>
> > > >>>Hi Adam -
> > > >>>
> > > >>>As another shot in the dark, maybe in your
> build
> > > >>
> > > >>process you don't delete
> > > >>
> > > >>>old .properties files?  In the past I left
> out
> > > >>
> > > >>this step in my build process
> > > >>
> > > >>>and had strange results similar to what you
> are
> > > >>
> > > >>describing.  Have you
> > > >>
> > > >>>searched your filesystem for the old
> > > >>
> > > >>_de.properties file to see if it's
> > > >>
> > > >>>lingering somewhere?
> > > >>>
> > > >>>Other than that, I too am stumped ...
> > > >>>
> > > >>>Matt
> > > >>>----- Original Message ----- 
> > > >>>From: "Adam Hardy"
> > > >>
> > > >><ahardy.struts@cyberspaceroad.com>
> > > >>
> > > >>>To: "Tag Libraries Users List"
> > > >>
> > > >><taglibs-user@jakarta.apache.org>
> > > >>
> > > >>>Sent: Wednesday, January 21, 2004 6:03 AM
> > > >>>Subject: Re: ApplicationResources.properties
> > > >>
> > > >>apparently cached
> > > >>
> > > >>>
> > > >>>
> > > >>>>Thanks for the response. I know exactly how
> it
> > > >>
> > > >>must look to people
> > > >>
> > > >>>>reading this, but what you are suggesting is
> > > what
> > > >>
> > > >>I have been doing for
> > > >>
> > > >>>>the past week. I'm 99% positive that this is
> not
> > > a
> > > >>
> > > >>result of browser or
> > > >>
> > > >>>>proxy or JSP caching.
> > > >>>>
> > > >>>>On 01/21/2004 11:54 AM Evgeny Gesin wrote:
> > > >>>>
> > > >>>>
> > > >>>>>I think somethings can be wrong with
> > > application
> > > >>
> > > >>or
> > > >>
> > > >>>>>understanding how it works with
> > > >>
> > > >>bundle.properties, if
> > > >>
> > > >>>>>DE still cached. Try to remove compiled
> pages
> > > >>
> > > >>(under
> > > >>
> > > >>>>>the "work" directory in Tomcat), stop and
> start
> > > >>
> > > >>Tomcat
> > > >>
> > > >>>>>and point browser to the same pages again
> and
> > > see
> > > >>
> > > >>what
> > > >>
> > > >>>>>happen.
> > > >>>>>
> > > >>>>>Evgeny Gesin
> > > >>>>>Javadesk CEO / Founder
> > > >>>>>
> > > >>>>>
> > > >>>>>--- Adam Hardy
> > > <ahardy.struts@cyberspaceroad.com>
> > > >>>>>wrote:
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>>Can anybody make any comment about this?
> Other
> > > >>
> > > >>than
> > > >>
> > > >>>>>>that you think I
> > > >>>>>>might be losing it?
> > > >>>>>>
> > > >>>>>>Thanks
> > > >>>>>>
> > > >>>>>>On 01/20/2004 06:38 PM Adam Hardy wrote:
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>>I have set up my i18n properties files
> for
> > > use
> > > >>>>>>
> > > >>>>>>with the <fmt:message>
> > > >>>>>>
> > > >>>>>>>taglib (jstl 1.0) via the
> > > >>>>>>
> > >
> >>>>>>javax.servlet.jsp.jstl.fmt.localizationContext
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>>and I tested it out with DE and EN to
> make
> > > sure
> > > >>
> > > >>my
> > > >>
> > > >>>>>>different locales on
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>>the browser would generate the correct
> > > language
> > > >>>>>>
> > > >>>>>>text.
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>>All worked, and so I deleted the German
> file,
> > > >>>>>>
> > > >>>>>>since it was only a test
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>>and I'm not ready to do all the proper
> > > >>
> > > >>translation
> > > >>
> > > >>>>>>into German yet.
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>>I deleted the _en.properties and
> > > _de.properties
> > > >>>>>>
> > > >>>>>>files, and have only a
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>>default ApplicationResources.properties
> so I
> > > >>>>>>
> > > >>>>>>really can't see where the
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>>old German strings are coming from.
> > > >>>>>>>
> > > >>>>>>>However the German strings keep appearing
> in
> > > my
> > > >>>>>>
> > > >>>>>>web pages in German
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>>browsers.
> > > >>>>>>>
> > > >>>>>>>This has been troubling me for a month
> now
> > > and
> > > >>
> > > >>I'm
> > > >>
> > > >>>>>>really determined to
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>>fix it. I'm sure it's not being cached by
> the
> > > >>>>>>
> > > >>>>>>browser or by a proxy.
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>>Chopping and changing the locale in the
> > > browser
> > > >>>>>>
> > > >>>>>>proves that.
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>>What also puzzles me is the work-around I
> > > did:
> > > >>
> > > >>I
> > > >>
> > > >>>>>>recreated the German
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>>_de.properties file, and so now I have
> > > >>
> > > >>something
> > > >>
> > > >>>>>>sensible (the old
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>>strings are pretty stupid random bits of
> > > text).
> > > >>>>>>
> > > >>>>>>But when I deleted this
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>>new German file to test if the bug had
> gone,
> > > >>
> > > >>the
> > > >>
> > > >>>>>>old German strings
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>>reappeared.
> > > >>>>>>>
> > > >>>>>>>What is my next logical step? I'm
> completely
> > > >>
> > > >>stuck
> > > >>
> > > >>>>>>here.
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>>Thanks
> > > >>>>>>>Adam
> 
> -- 
> Kris Schneider <mailto:kris@dotech.com>
> D.O.Tech       <http://www.dotech.com/>
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> taglibs-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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


Mime
View raw message