permaculture playing cards
The moose likes Struts and the fly likes Help with properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Help with properties file" Watch "Help with properties file" New topic

Help with properties file

s logeson

Joined: Jan 14, 2004
Posts: 2
I am trying to use the ApplicationResources dot properties file in my "very" small test struts application. However, everytime I build my application (I'm using Netbeans) it deletes the "WEB-INF/classes" directory which is where several tutorials tell you to place this file.
To get my application to work, I'm having to copy it from a directory I created "c:\propertiesFile" into my tomcat\webapps\folder\<name-of-my-app>\WEB-INF\classes".
So, what am I doing wrong.
Is is because of something in my build file??
<project name="ematrix" default="war" basedir=".">
<!-- change these to suit environment -->
<property name="jdk.home" value="C:/j2sdk1.4.1_02"/>
<!-- catalina (tomcat 4) setup -->
<property name="webserver.home"value="C:/jakarta-tomcat-4.1.29"/>
<property name="webserver.deploy" value="${webserver.home}/webapps"/>
<property name="servlet.jar" value="${webserver.home}/common/lib/servlet.jar"/>
<!-- project structure - should not have to modify -->
<property name="src.dir" value="src"/>
<!-- property name="web.dir" value="web"/-->
<property name="web.dir" value="." />
<property name="build.dir" value="build"/>
<property name="dist.dir" value="dist"/>
<property name="lib.dir" value="lib"/>
<!-- CLASSPATH used during compilation -->
<path id="build.classpath">
<pathelement location="${servlet.jar}"/>
<pathelement location="${lib.dir}/commons-beanutils.jar"/>
<pathelement location="${lib.dir}/commons-collections.jar"/>
<pathelement location="${lib.dir}/commons-dbcp.jar"/>
<pathelement location="${lib.dir}/commons-digester.jar"/>
<pathelement location="${lib.dir}/commons-logging.jar"/>
<pathelement location="${lib.dir}/commons-pool.jar"/>
<pathelement location="${lib.dir}/commons-services.jar"/>
<pathelement location="${lib.dir}/commons-validator.jar"/>
<pathelement location="${lib.dir}/jdbc2_0-stdext.jar"/>
<pathelement location="${lib.dir}/log4j.jar"/>
<pathelement location="${lib.dir}/poolman.jar"/>
<pathelement location="${lib.dir}/struts.jar"/>
<pathelement location="${lib.dir}/ojb-0.8.375.jar"/>
<pathelement location="${lib.dir}/tiles.jar"/>
<pathelement path="${build.dir}" />
<!-- Pre-compilation rule -->
<target name="prepare">
<mkdir dir="${build.dir}" />
<mkdir dir="${dist.dir}/lib" />
<!-- Compiling rule -->
<target name="compile" depends="prepare">
<javac destdir="${build.dir}" deprecation="on">
<classpath refid="build.classpath" />
<src path="${src.dir}" />
<!-- WAR rules -->
<target name="war" depends="compile">
<echo>building war...</echo>
<war warfile="${dist.dir}/lib/ematrix.war" webxml="${web.dir}/WEB-INF/web.xml">
<fileset dir="${web.dir}"/>
<classes dir="${build.dir}"/>
<classes dir="${lib.dir}">
<include name="*.properties"/>
<include name="poolman.xml"/>
<lib dir="${lib.dir}">
<include name="*.jar"/>
<!-- Deploy rule -->
<target name="deploy" depends="war">
<echo>copying war file to deployment dir...</echo>
<copy file="${dist.dir}/lib/ematrix.war" todir="${webserver.deploy}"/>
<!-- clean compilation remnants -->
<target name="clean">
<delete dir="${build.dir}" />
<!-- completely clean all compilation results -->
<target name="distclean">
<antcall target="clean"/>
<delete dir="${dist.dir}" />
Rick Hightower
Ranch Hand

Joined: Feb 20, 2002
Posts: 350
This really belongs in the NetBeans forum.
My suggestion use Eclipse with the MyEclipse plugin, which works well with Struts and JSP.

Rick Hightower is CTO of Mammatus which focuses on Cloud Computing, EC2, etc. Rick is invovled in Java CDI and Java EE as well. linkedin,twitter,blog
Have you checked out Aspose?
subject: Help with properties file
It's not a secret anymore!