Magazine
 
Struts2
<!— Normal build of application —>
<target name=”compile”
depends=”prepare,resources”>
<javac srcdir=”src” destdir=”src/classes”
debug=”true”
debuglevel=”lines,vars,source”>
<classpath refid=”class.path”/>
</javac>
<jar jarfile=”lib/${project.jar.file}”
basedir=”src/classes”/>
</target>
<!— Remove classes directory for clean build
—>
<target name=”clean” description=”Prepare
for clean build”>
<delete dir=”classes”/>
<mkdir dir=”classes”/>
</target>
<!— Build Javadoc documentation —>
<target name=”javadoc”
description=”Generate JavaDoc API docs”>
<delete dir=”./doc/api”/>
<mkdir dir=”./doc/api”/>
<javadoc sourcepath=”./src/java” destdir=”./
doc/api”
classpath=”${servlet.jar}:${jdbc20ext.jar}”
packagenames=”*” author=”true”
private=”true” version=”true”
windowtitle=”${project.title}API
Documentation”
doctitle=”&lt;h1&gt;${project.title}Documentation
(Version ${project.version})&lt;/h1&gt;”
bottom=”Copyright &#169; 2002">
<classpath refid=”compile.classpath”/>
</javadoc>
</target>
<!— Build entire project —>
<target name=”project”
depends=”clean,prepare,compile”/>
<!— Create binary distribution —>
<target name=”dist” description=”Create
binary distribution”>
<mkdir dir=”${distpath.project}”/>
<jar jarfile=”${distpath.project}/
${project.distname}.jar”
basedir=”./classes”/>
<copy file=”${distpath.project}/
${project.distname}.jar”
todir=”${distpath.project}”/>
<war basedir=”../”
warfile=”${distpath.project}/
 

${project.distname}.war”webxml=”web.xml”>
<exclude name=”${distpath.project}/
${project.distname}.war”/>
</war></target>
<!— Build project and create distribution—>
<target name=”all” depends=”project”/>
</project>.

Step 4: Create directory libext under the struts2example\WEB-INF\ and copy latest Servlets api jar (in our case servlet-api.jar) file over there. This library file will be used to compile Servlets in our application.

Step 5: Now create directories java and classes under struts2example\WEB-INF\src. The directory truts2example\WEBINF\src\java will be used to put all the java sources file and directory  struts2example\WEB-INF\src\classes will be used by ant build utility to store compiled java files



 

Nov 2007 | Java Jazz Up | 33
 
previous
index
next
 
View All Topics
All Pages of this Issue
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

30
, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 , 54, 55, 56, 57,

58
, 59, 60, 61, 62, 63 , 64, 65 , 66 , 67 , 68 , 69   Download PDF