This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Help with properties file" Watch "Help with properties file" New topic
Author

Help with properties file

s logeson
Greenhorn

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}" />
</path>
<!-- Pre-compilation rule -->
<target name="prepare">
<tstamp/>
<mkdir dir="${build.dir}" />
<mkdir dir="${dist.dir}/lib" />
</target>
<!-- Compiling rule -->
<target name="compile" depends="prepare">
<javac destdir="${build.dir}" deprecation="on">
<classpath refid="build.classpath" />
<src path="${src.dir}" />
</javac>
</target>
<!-- 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"/>
</classes>
<lib dir="${lib.dir}">
<include name="*.jar"/>
</lib>
</war>
</target>
<!-- 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}"/>
</target>
<!-- clean compilation remnants -->
<target name="clean">
<delete dir="${build.dir}" />
</target>
<!-- completely clean all compilation results -->
<target name="distclean">
<antcall target="clean"/>
<delete dir="${dist.dir}" />
</target>
</project>
Rick Hightower
Author
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with properties file
 
Similar Threads
ant exception
Struts2:NoClassDefFoundError for pdf parsing using itext
Which IDE support JSP 2.0
Compilation error while building the project using Ant
Ant build fail, sometimes 'cause ant forgets property