ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Medwith" <>
Subject RE: JSPC task and package names
Date Fri, 09 May 2003 14:58:51 GMT
Actually I am getting the package "org.apache.jsp" which matches what tomcat
does to the jsp files.  What I dont understand is tomcat compiles each java
version to the same directory as the jsp file for example:

test.jsp is under /general/jsp is place in the work directory under: /general/jsp
test_jsp.class is compiled by tomcat with the package "org.apache.jsp" but
under: /general/jsp
ant compiles the java file under: /org/apache/jsp and tomcat cannot find it
and recompiles the jsp itself

Any ideas?

for your problem change the destdir in the jspc task to the base dir for the
jsps.... the "." will just put them wherever you curretnly are.....

my tasks are a little messy I had to break up the compilation I run AIX
which doesn't like more than a few hundred files at once and I am up to 400
or something.....

  <!-- jspc/javac task -->
  <target name="jasper_jsp">
    <echo message="Jaspering JSPs (converting .jsp to .java)" />
    <jspc srcdir="${jsproot}" uriroot="${jsproot}" destdir="${jsproot}"
classpathref="project.class.path" verbose="0" failonerror="no">
      <exclude name="general/**/*.jsp" />
      <exclude name="*/**/index.jsp" />
      <include name="*/**/*.jsp" />
    <jspc srcdir="${jsproot}" uriroot="${jsproot}" destdir="${jsproot}"
classpathref="project.class.path" verbose="0" failonerror="no">
      <include name="general/**/*.jsp" />

  <target name="compile_jsp">
    <echo message="Compiling JSPs for tomcat" />
    <javac srcdir="${jsproot}"
      <include name="**/*.java"/>


hello mike.

Funny you should say that,because I think I am having the opposite problem.
First I think you need to define define the

in your <jspc/> task.

But my problem is that I actually want the java files to be placed in the
the same directory as the original jsp file for now. But it is placing them
in the Base dir of the ant project. In addition it
is not creating the subdirectory names based off of the package attribute I
supplied to my task. I guess it is because of the fact that I defined

But what do I define it to have the files placed where I want them and the
subdirectories based off of that package name?

Here is what my task looks like:
  <include name="**/*.jsp" />
      <pathelement path="${env.CLASSPATH}"/>
      <path refid="classpath"/>


Can You show my what your jspc tasks looks like?

-----Original Message-----
From: Mike Medwith []
Sent: Thursday, May 08, 2003 3:05 PM
Subject: JSPC task and package names

All my jsps end up with a package name of org.apache.jsp and when these
files are compiled they are placed under those directories instead of the
subdirectories where the original jsp and java file curretnly live... is
there any way to keep the package name the same as the sub dirs that the
jsps are found in?


Add photos to your messages with MSN 8. Get 2 months FREE*.

View raw message