Torsten Frehe wrote:
my problem is, that I can“t put the properties into the class path.
I have to put the properties under Sourcecontrol.
I don't see the problem; just ask Ant (or whatever make tool you use) to
copy the properties files from a source controlled directory (I use
'meta' as a catch-all) into the newly built classpath on build. This is
pretty much best practice anyway, you should blow away your 'classes'
directory on a clean build to make sure you *know* what files need to be
on the classpath... I much prefer keeping this type of information
explicit in my build files.
This has tremendous advantages by the way, I copy loads of meta-files
into various locations on a build and Ant lets me filter them to include
various dynamic content depending on what build I'm doing. This ranges
from adjusting the log4j log level, to displaytags appearance, to the
product name and version shown in various places. Useful.
If you do use Ant, here are some bits of my (fancy) build.xml file which
might help; you can see that I define a 'patternset' (just a list of
files to match) near the start of the build. Later, after compiling
everything and checking XML syntax, I populate the classpath with
resources, and you can see that I apply some filters to these files then
too. If your build is much simpler, you might just have one <copy> after
your <javac> task.
<patternset id="classpath-resources">
<include name="**/messages*.properties"/>
<include name="**/displaytag*.properties"/>
</patternset>
<target name="add-metadata-to-classes"
depends="compile-junit,validate-xml-files">
<copy todir="${classes-dir}">
<fileset dir="${meta-dir}">
<patternset refid="classpath-resources"/>
</fileset>
<filterchain>
<striplinecomments>
<comment value="#"/>
</striplinecomments>
</filterchain>
<filterset refid="main.filterset"/>
</copy>
<copy todir="${classes-dir}">
<fileset dir="${data-dir}">
<include name="**/*.hbm.xml"/>
</fileset>
</copy>
</target>
<target name="build"
description="Runs all the build tasks"
depends="compile-junit, generate-web-inf,
add-metadata-to-classes, code-quality"/>
On 8/4/05, Rick Herrick <[EMAIL PROTECTED]> wrote:
Patrick Gelin said:
Hi,
i'm writting a webapp into tomcat. I created a displaytag_FR.properties
file
but I don't know where to put the file. I tried:
- MyWebappDir
- MyWebappDir/WEB-INF/lib (with displaytag-1.0.jar)
- {tomcat.home}/shared/classes
I *think* it's supposed to be displaytag_fr.properties (no caps), but I'm
not sure. Especially if you're on a *nic system, that may make a
difference as to whether the file can be located. I could be totally
wrong, but it's worth a shot if no one else chimes in :^)
By the way I didn't found any default displaytag.properties file but only
TableTag.properties. I used it to generate my displaytag_FR.properties...
That's correct. The defaults are found in TableTag.properties in the
displaytag library. But you put your overrides into displaytag.properties
or displaytag_xx.properties. Without knowing the specifics about why that
decision was made, I'd guess it's because of how the JVM class loader
works. Basically, if you have two resource bundles with the same name,
e.g. com/whatever/whichever/mystuff.properties or, in displaytag's case,
displaytag.properties, the first one found on the class loader's class
path is the one used. Thus, if the default properties file was called
displaytag.properties, the class loader wouldn't find your overriding
displaytag.properties. A quick look over the code in
TableProperties.java, which loads both of these properties files, will
help you understand how displaytag goes about handling these separate
resources.
--
Rick Herrick
[EMAIL PROTECTED]
I haven't got time for inner peace.
Get out of control, but appear under control. It's not bad to alarm other
people, though--it's good for them.--Hunter S. Thompson
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user
--
David Kennedy
Software Engineer
[EMAIL PROTECTED]
http://www.swanlabs.com
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user