• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with properties file  RSS feed

s logeson
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This really belongs in the NetBeans forum.
My suggestion use Eclipse with the MyEclipse plugin, which works well with Struts and JSP.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!