这是我ant的目录,还有里面是没有.java后缀的!
|-bookstore-|-WEB-INF-------| -----|---classes-------|-XX.class
|-src-------- |---lib---|--mysqldriver.jar
|--build.xml |--web.xml
|--xx.jsp |
|---......
|
|
|
|-bookstore-|-WEB-INF-------| -----|---classes-------|-XX.class
|-src-------- |---lib---|--mysqldriver.jar
|--build.xml |--web.xml
|--xx.jsp |
|---......
|
|
|
ant 到低怎么不正确了? 可不可以说明白点
<display-name>xxx</display-name>
<description>
xxxxx
</description>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/BookDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref></web-app>
这样试试还有贴出你的bulde.xml里面war那块代码
<target name="build" depends="compile" > <!-- Copy all the webapp content (jsp's, html, tld's, xml, etc. -->
<!-- Note that this also copies the META-INF directory -->
<copy todir="${build.home}">
<fileset dir="${web.home}"/>
</copy>楼主是怎么做的,也把**.jsp放到web目录下了吗,
哪位指点一下
还有我的.web.xml文件中有:
<resource-env-ref>
<description>Orders Account DataSource</description>
<resource-env-ref-name>jdbc/test</resource-env-ref-name>
<resource-env-ref-type>javax.sql.DataSource</resource-env-ref-type>
</resource-env-ref>
<project name="bookstore" default="about" basedir="."> <target name="init">
<tstamp/>
<property name="build" value="build" />
<property name="src" value="src" />
<property environment="myenv" />
<property name="servletpath" value="${myenv.CATALINA_HOME}/common/lib/servlet-api.jar" />
<property name="mysqlpath" value="WEB-INF/lib/mysqldriver.jar" /> <mkdir dir="${build}" />
<mkdir dir="${build}\WEB-INF" />
<mkdir dir="${build}\WEB-INF\classes" /> <copy todir="${build}" >
<fileset dir="${basedir}" >
<include name="*.jsp" />
<include name="*.bmp" />
<include name="WEB-INF/**" />
<exclude name="build.xml" />
</fileset>
</copy>
</target>
<target name="compile" depends="init"> <javac srcdir="${src}"
destdir="${build}/WEB-INF/classes"
classpath="${servletpath}:${mysqlpath}">
</javac>
</target>
<target name="bookstorewar" depends="compile"> <war warfile="${build}/bookstore.war" webxml="${build}/WEB-INF/web.xml">
<lib dir="${build}/WEB-INF/lib"/>
<classes dir="${build}/WEB-INF/classes"/>
<fileset dir="${build}"/>
</war>
</target> <target name="about" >
<echo>
This build.xml file contains targets
for building bookstore web application
</echo>
</target></project>
<lib dir="${build}/WEB-INF/lib"/>
<classes dir="${build}/WEB-INF/classes"/>
<fileset dir="${build}"/>
</war>
</target>
<display-name>xxx</display-name>
<description>
xxxxx
</description>
这个是有什么作用的?
没有用吗?