You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by jo...@fwd.at on 2003/04/03 13:46:02 UTC

Tomcat JSPC Precompile using Ant - unique jsp name problem

hi there,

I've searched the whole forum but haven't found any definitive answer on 
this issue;

If somebody runs JSPC using ANT to precompile all the JSPs, the precompile 
fails if any of the JSPs in  different directories has the same name. 

/jsp/mydir1/index.jsp
/jsp/mydir2/index.jsp
==> JSPC fails with a quite confusing error message, which boils down to 
not having unique JSP names.

Uniquely naming all JSPs is probably not an option because index.jsp is 
quite convenient.
==> I've also scanned the Tomcat 4.1.24 release notes, but haven't found a 
fix there.

Does anybody know how to fix this JSP naming problem??

Thx alot
Johannes

Re: Tomcat JSPC Precompile using Ant - unique jsp name problem

Posted by Steve Loughran <st...@iseran.com>.
well, that means its a bug in jasper.

----- Original Message -----
From: <jo...@fwd.at>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Monday, April 07, 2003 12:35
Subject: Re: Tomcat JSPC Precompile using Ant - unique jsp name problem


> Hi Steve,
>
> Thx alot for posting your configuration details, unfortunately it hasn't
> worked out yet for me and I have to repost in this issue!
> I tried using JSPC now, but it seems that the same problem happens with
> the webapp option activated. It seems the webapp option only helps if
> duplicate names occur in different webapps, not within the same webapp
> (?).
>
> jspc task definition:
> ====================
> <target name="jspc">
>
>     <jspc  compiler="jasper41" destdir="src" uriroot="/jsp"
>         webinc="${basedir}/webinc.xml" >
>         <classpath id="jspc.classpath">
>         <pathelement location="${java.home}/../lib/tools.jar"/>
>         <fileset dir="${catalina.home}/server/lib">
>           <include name="*.jar"/>
>         </fileset>
>         <fileset dir="${catalina.home}/common/lib">
>           <include name="*.jar"/>
>         </fileset>
>         <!-- include all JARs in lib-directory -->
>         <fileset dir="${build.home}/WEB-INF/lib/">
>                 <include name="*.jar"/>
>         </fileset>
>
>       </classpath>
>
>            <webapp  basedir="jsp" />
>
>     </jspc>
>
>   </target>
> ====================
>
> and here are my compile results:
> ====================
>     [javac] Compiling 16 source files to
> E:\develop\devapp\forms\build\WEB-INF\classes
>     [javac] E:\develop\forms\src\kbgverzicht\final_jsp.java:11: duplicate
> class: org.apache.jsp.final_jsp
>     [javac] public class final_jsp extends HttpJspBase {
> ====================
>
> Since the problem always occurs during compile, maybe should I use
> different compiler options?
> ==========================================
> <javac srcdir="${src.home}"
>           destdir="${build.home}/WEB-INF/classes"
>             debug="${compile.debug}"
>       deprecation="${compile.deprecation}"
>          optimize="${compile.optimize}"
>        (I also tried: fork="yes" / include="mypath1" / exclude="mypath2")
> >
> ==========================================
> *) I tried setting fork to "yes", but it didn't help. (since all *.java
> are still compiled together at a time).
> *) Using "include="mydir/"" works, but I'd have to specify each directory
> separately and define a separate JSP-Task for this, which would be quite
> inconvenient?
>
> ==>
> *) Is there any standard way to loop through all subdirectories and
> compile each subdirectory separately (that would solve the problem)? Or do
> I have to write a custom task for this (which would be a general bugfix of
> the whole problem as it appears to me)?
>
> thx alot
> Johannes
>
>
>
>
>
> "Steve Loughran" <st...@iseran.com>
> 07.04.2003 08:07
> Please respond to
> "Ant Users List" <us...@ant.apache.org>
>
>
> To
> "Ant Users List" <us...@ant.apache.org>
> cc
>
> Subject
> Re: Tomcat JSPC Precompile using Ant - unique jsp name problem
>
>
>
>
>
>
>
> ----- Original Message -----
> From: <jo...@fwd.at>
> To: "Ant Users List" <us...@ant.apache.org>
> Sent: Sunday, April 06, 2003 13:54
> Subject: Re: Tomcat JSPC Precompile using Ant - unique jsp name problem
>
>
> > Hi Steve,
> >
> > Does the jspc-task also work for compiling JSPs using Jasper (and solve
> > the problem of similarly named JSPs)?
>
> no, it has the same bug (which is part of jasper) unless you use the
> <webapp> feature
>
> > If yes, could you post a brief sample of your working ant
> taskdefinition?
>
> I already have
>
> > > <jspc destdir="build/jspc" compiler="jasper41" >
> > >   <webapp basedir="src/webapp" />
> > > </jspc>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>


Re: Tomcat JSPC Precompile using Ant - unique jsp name problem

Posted by jo...@fwd.at.
Hi Steve,

Thx alot for posting your configuration details, unfortunately it hasn't 
worked out yet for me and I have to repost in this issue!
I tried using JSPC now, but it seems that the same problem happens with 
the webapp option activated. It seems the webapp option only helps if 
duplicate names occur in different webapps, not within the same webapp 
(?).

jspc task definition:
====================
<target name="jspc">

    <jspc  compiler="jasper41" destdir="src" uriroot="/jsp"
        webinc="${basedir}/webinc.xml" >
        <classpath id="jspc.classpath">
        <pathelement location="${java.home}/../lib/tools.jar"/>
        <fileset dir="${catalina.home}/server/lib">
          <include name="*.jar"/>
        </fileset>
        <fileset dir="${catalina.home}/common/lib">
          <include name="*.jar"/>
        </fileset>
        <!-- include all JARs in lib-directory -->
        <fileset dir="${build.home}/WEB-INF/lib/">
                <include name="*.jar"/>
        </fileset>

      </classpath>

           <webapp  basedir="jsp" />

    </jspc>

  </target>
====================

and here are my compile results:
====================
    [javac] Compiling 16 source files to 
E:\develop\devapp\forms\build\WEB-INF\classes
    [javac] E:\develop\forms\src\kbgverzicht\final_jsp.java:11: duplicate 
class: org.apache.jsp.final_jsp
    [javac] public class final_jsp extends HttpJspBase {
====================

Since the problem always occurs during compile, maybe should I use 
different compiler options? 
==========================================
<javac srcdir="${src.home}"
          destdir="${build.home}/WEB-INF/classes"
            debug="${compile.debug}"
      deprecation="${compile.deprecation}"
         optimize="${compile.optimize}"
       (I also tried: fork="yes" / include="mypath1" / exclude="mypath2") 
>
==========================================
*) I tried setting fork to "yes", but it didn't help. (since all *.java 
are still compiled together at a time).
*) Using "include="mydir/"" works, but I'd have to specify each directory 
separately and define a separate JSP-Task for this, which would be quite 
inconvenient? 

==>
*) Is there any standard way to loop through all subdirectories and 
compile each subdirectory separately (that would solve the problem)? Or do 
I have to write a custom task for this (which would be a general bugfix of 
the whole problem as it appears to me)?

thx alot
Johannes





"Steve Loughran" <st...@iseran.com> 
07.04.2003 08:07
Please respond to
"Ant Users List" <us...@ant.apache.org>


To
"Ant Users List" <us...@ant.apache.org>
cc

Subject
Re: Tomcat JSPC Precompile using Ant - unique jsp name problem







----- Original Message -----
From: <jo...@fwd.at>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Sunday, April 06, 2003 13:54
Subject: Re: Tomcat JSPC Precompile using Ant - unique jsp name problem


> Hi Steve,
>
> Does the jspc-task also work for compiling JSPs using Jasper (and solve
> the problem of similarly named JSPs)?

no, it has the same bug (which is part of jasper) unless you use the
<webapp> feature

> If yes, could you post a brief sample of your working ant 
taskdefinition?

I already have

> > <jspc destdir="build/jspc" compiler="jasper41" >
> >   <webapp basedir="src/webapp" />
> > </jspc>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org



Re: Tomcat JSPC Precompile using Ant - unique jsp name problem

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: <jo...@fwd.at>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Sunday, April 06, 2003 13:54
Subject: Re: Tomcat JSPC Precompile using Ant - unique jsp name problem


> Hi Steve,
>
> Does the jspc-task also work for compiling JSPs using Jasper (and solve
> the problem of similarly named JSPs)?

no, it has the same bug (which is part of jasper) unless you use the
<webapp> feature

> If yes, could you post a brief sample of your working ant taskdefinition?

I already have

> > <jspc destdir="build/jspc" compiler="jasper41" >
> >   <webapp basedir="src/webapp" />
> > </jspc>



Re: Tomcat JSPC Precompile using Ant - unique jsp name problem

Posted by jo...@fwd.at.
Hi Steve,

Does the jspc-task also work for compiling JSPs using Jasper (and solve 
the problem of similarly named JSPs)? 
If yes, could you post a brief sample of your working ant taskdefinition?

thx alot for your support!
Johannes




"Steve Loughran" <st...@iseran.com> 
05.04.2003 23:44
Please respond to
"Ant Users List" <us...@ant.apache.org>


To
"Ant Users List" <us...@ant.apache.org>
cc

Subject
Re: Tomcat JSPC Precompile using Ant - unique jsp name problem







----- Original Message -----
From: <jo...@fwd.at>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Saturday, April 05, 2003 10:22
Subject: Re: Tomcat JSPC Precompile using Ant - unique jsp name problem


> hi steve,
>
> It seems we are using different tasks for generating the JSPs (and
> unfortunately I don't have your complete definition):

I've been talking about the <jspc> task that ships with Ant 1.5.

>
> My taskdefinition looks like:
> ==========================
> <target name="jspc">
>     <taskdef classname="org.apache.jasper.JspC" name="jasper2">
>       <classpath id="jspc.classpath">
>         <pathelement location="${java.home}/../lib/tools.jar"/>
>         <fileset dir="${catalina.home}/server/lib">
>           <include name="*.jar"/>
>         </fileset>
>         <fileset dir="${catalina.home}/common/lib">
>           <include name="*.jar"/>
>         </fileset>
>         <!-- include all JARs in lib-directory -->
>         <fileset dir="${build.home}/WEB-INF/lib/">
>                 <include name="*.jar"/>
>         </fileset>
>
>       </classpath>
>
>
>     </taskdef>
>
>     <jasper2 destdir="build/" compiler="jasper41"    >
>        <webapp basedir="src/webapp" />
>     </jasper2>
>
>   </target>
> ==========================
>
> If I try to add <webapp basedir="src/webapp" /> within the taskdef, I 
get
> the following error:
> ==========================
> Buildfile: build.xml
>
> BUILD FAILED
> file:E:/esvdevelop/devapp/forms/build.xml:513: The <jasper2> task 
doesn't
> support the nested "webapp" element.
> ==========================
>
> Could you please post your complete taskdefinition, so I can easily 
paste
> the working solution?
> Or do I have to add something to make the jasper2 task support the 
webapp
> element??
>
> thx alot
> Johannes
>
>
>
>
>
> Steve Loughran <st...@iseran.com>
> 04.04.2003 02:13
> Please respond to
> "Ant Users List" <us...@ant.apache.org>
>
>
> To
> Ant Users List <us...@ant.apache.org>
> cc
>
> Subject
> Re: Tomcat JSPC Precompile using Ant - unique jsp name problem
>
>
>
>
>
>
> johannes.fiala@fwd.at wrote:
> > Hi Steve,
> >
> > I have ant 1.5.2 and tried to find more about the webapp option.
> > However, at http://ant.apache.org/manual/OptionalTasks/jspc.html
> > I only found that the option exist, but not how to use it.
> >
> > I tried this.
> > ============
> > <taskdef classname="org.apache.jasper.JspC" name="jasper2"
> > webapp="true">
>
> its a nested element
>
> <jspc destdir="build/jspc" compiler="jasper41" >
>   <webapp basedir="src/webapp" />
> </jspc>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org



Re: Tomcat JSPC Precompile using Ant - unique jsp name problem

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: <jo...@fwd.at>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Saturday, April 05, 2003 10:22
Subject: Re: Tomcat JSPC Precompile using Ant - unique jsp name problem


> hi steve,
>
> It seems we are using different tasks for generating the JSPs (and
> unfortunately I don't have your complete definition):

I've been talking about the <jspc> task that ships with Ant 1.5.

>
> My taskdefinition looks like:
> ==========================
> <target name="jspc">
>     <taskdef classname="org.apache.jasper.JspC" name="jasper2">
>       <classpath id="jspc.classpath">
>         <pathelement location="${java.home}/../lib/tools.jar"/>
>         <fileset dir="${catalina.home}/server/lib">
>           <include name="*.jar"/>
>         </fileset>
>         <fileset dir="${catalina.home}/common/lib">
>           <include name="*.jar"/>
>         </fileset>
>         <!-- include all JARs in lib-directory -->
>         <fileset dir="${build.home}/WEB-INF/lib/">
>                 <include name="*.jar"/>
>         </fileset>
>
>       </classpath>
>
>
>     </taskdef>
>
>     <jasper2 destdir="build/" compiler="jasper41"    >
>        <webapp basedir="src/webapp" />
>     </jasper2>
>
>   </target>
> ==========================
>
> If I try to add <webapp basedir="src/webapp" /> within the taskdef, I get
> the following error:
> ==========================
> Buildfile: build.xml
>
> BUILD FAILED
> file:E:/esvdevelop/devapp/forms/build.xml:513: The <jasper2> task doesn't
> support the nested "webapp" element.
> ==========================
>
> Could you please post your complete taskdefinition, so I can easily paste
> the working solution?
> Or do I have to add something to make the jasper2 task support the webapp
> element??
>
> thx alot
> Johannes
>
>
>
>
>
> Steve Loughran <st...@iseran.com>
> 04.04.2003 02:13
> Please respond to
> "Ant Users List" <us...@ant.apache.org>
>
>
> To
> Ant Users List <us...@ant.apache.org>
> cc
>
> Subject
> Re: Tomcat JSPC Precompile using Ant - unique jsp name problem
>
>
>
>
>
>
> johannes.fiala@fwd.at wrote:
> > Hi Steve,
> >
> > I have ant 1.5.2 and tried to find more about the webapp option.
> > However, at http://ant.apache.org/manual/OptionalTasks/jspc.html
> > I only found that the option exist, but not how to use it.
> >
> > I tried this.
> > ============
> > <taskdef classname="org.apache.jasper.JspC" name="jasper2"
> > webapp="true">
>
> its a nested element
>
> <jspc destdir="build/jspc" compiler="jasper41" >
>   <webapp basedir="src/webapp" />
> </jspc>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>


Re: Tomcat JSPC Precompile using Ant - unique jsp name problem

Posted by jo...@fwd.at.
hi steve,

It seems we are using different tasks for generating the JSPs (and 
unfortunately I don't have your complete definition):

My taskdefinition looks like:
==========================
<target name="jspc">
    <taskdef classname="org.apache.jasper.JspC" name="jasper2">
      <classpath id="jspc.classpath">
        <pathelement location="${java.home}/../lib/tools.jar"/>
        <fileset dir="${catalina.home}/server/lib">
          <include name="*.jar"/>
        </fileset>
        <fileset dir="${catalina.home}/common/lib">
          <include name="*.jar"/>
        </fileset>
        <!-- include all JARs in lib-directory -->
        <fileset dir="${build.home}/WEB-INF/lib/">
                <include name="*.jar"/>
        </fileset>

      </classpath>


    </taskdef>

    <jasper2 destdir="build/" compiler="jasper41"    >
       <webapp basedir="src/webapp" />
    </jasper2>

  </target>
==========================

If I try to add <webapp basedir="src/webapp" /> within the taskdef, I get 
the following error:
==========================
Buildfile: build.xml

BUILD FAILED
file:E:/esvdevelop/devapp/forms/build.xml:513: The <jasper2> task doesn't 
support the nested "webapp" element.
==========================

Could you please post your complete taskdefinition, so I can easily paste 
the working solution?
Or do I have to add something to make the jasper2 task support the webapp 
element??

thx alot
Johannes





Steve Loughran <st...@iseran.com> 
04.04.2003 02:13
Please respond to
"Ant Users List" <us...@ant.apache.org>


To
Ant Users List <us...@ant.apache.org>
cc

Subject
Re: Tomcat JSPC Precompile using Ant - unique jsp name problem






johannes.fiala@fwd.at wrote:
> Hi Steve,
> 
> I have ant 1.5.2 and tried to find more about the webapp option.
> However, at http://ant.apache.org/manual/OptionalTasks/jspc.html
> I only found that the option exist, but not how to use it. 
> 
> I tried this.
> ============
> <taskdef classname="org.apache.jasper.JspC" name="jasper2" 
> webapp="true">

its a nested element

<jspc destdir="build/jspc" compiler="jasper41" >
  <webapp basedir="src/webapp" />
</jspc>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org



Re: Tomcat JSPC Precompile using Ant - unique jsp name problem

Posted by Steve Loughran <st...@iseran.com>.
johannes.fiala@fwd.at wrote:
> Hi Steve,
> 
> I have ant 1.5.2 and tried to find more about the webapp option.
> However, at http://ant.apache.org/manual/OptionalTasks/jspc.html
> I only found that the option exist, but not how to use it. 
> 
> I tried this.
> ============
> <taskdef classname="org.apache.jasper.JspC" name="jasper2" 
> webapp="true">

its a nested element

<jspc destdir="build/jspc" compiler="jasper41" >
  <webapp basedir="src/webapp" />
</jspc>


Re: Tomcat JSPC Precompile using Ant - unique jsp name problem

Posted by jo...@fwd.at.
Hi Steve,

I have ant 1.5.2 and tried to find more about the webapp option.
However, at http://ant.apache.org/manual/OptionalTasks/jspc.html
I only found that the option exist, but not how to use it. 

I tried this.
============
<taskdef classname="org.apache.jasper.JspC" name="jasper2" 
webapp="true">
============
but receive the following error:
============
Buildfile: build.xml

prepare:
     [copy] Copying 15 files to 
E:\esvdevelop\devapp\forms\build\WEB-INF\lib

jspc:

BUILD FAILED
file:E:/esvdevelop/devapp/forms/build.xml:485: The <taskdef> task doesn't 
support the "webapp" attribute.
============

Do you know where I can find a sample for the new webapp option?

p.s. What I do not fully understand is, that Tomcat itself * is * able to 
compile the JSPs, but JSPC is not? It seems the wrong package name/class 
name combination (not taking care of the directory structure) throws the 
error "    [javac] duplicate class: org.apache.jsp.final_jsp".

thx 
Johannes




Steve Loughran <st...@iseran.com> 
03.04.2003 19:54
Please respond to
"Ant Users List" <us...@ant.apache.org>


To
Ant Users List <us...@ant.apache.org>
cc

Subject
Re: Tomcat JSPC Precompile using Ant - unique jsp name problem






johannes.fiala@fwd.at wrote:
> hi there,
> 
> I've searched the whole forum but haven't found any definitive answer on 

> this issue;
> 
> If somebody runs JSPC using ANT to precompile all the JSPs, the 
precompile 
> fails if any of the JSPs in  different directories has the same name. 
> 
> /jsp/mydir1/index.jsp
> /jsp/mydir2/index.jsp
> ==> JSPC fails with a quite confusing error message, which boils down to 

> not having unique JSP names.
> 
> Uniquely naming all JSPs is probably not an option because index.jsp is 
> quite convenient.
> ==> I've also scanned the Tomcat 4.1.24 release notes, but haven't found 
a 
> fix there.
> 
> Does anybody know how to fix this JSP naming problem??
> 
> Thx alot
> Johannes

As it stands, this is a known and outstanding defect. Jasper is 
compiling everything in to one directory, and we'll probably have to do 
something in <jspc> to circumvent it.

If you have ant1.5.2, try building the jsps using the webapp option.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org



Re: Tomcat JSPC Precompile using Ant - unique jsp name problem

Posted by Steve Loughran <st...@iseran.com>.
johannes.fiala@fwd.at wrote:
> hi there,
> 
> I've searched the whole forum but haven't found any definitive answer on 
> this issue;
> 
> If somebody runs JSPC using ANT to precompile all the JSPs, the precompile 
> fails if any of the JSPs in  different directories has the same name. 
> 
> /jsp/mydir1/index.jsp
> /jsp/mydir2/index.jsp
> ==> JSPC fails with a quite confusing error message, which boils down to 
> not having unique JSP names.
> 
> Uniquely naming all JSPs is probably not an option because index.jsp is 
> quite convenient.
> ==> I've also scanned the Tomcat 4.1.24 release notes, but haven't found a 
> fix there.
> 
> Does anybody know how to fix this JSP naming problem??
> 
> Thx alot
> Johannes

As it stands, this is a known and outstanding defect. Jasper is 
compiling everything in to one directory, and we'll probably have to do 
something in <jspc> to circumvent it.

If you have ant1.5.2, try building the jsps using the webapp option.


Re: ant path and file name

Posted by Martin <mg...@hotmail.com>.
the Install/setup will put a ANT_HOME environment variable
the bin has all the binaries
doc has help docs
What are you're looking for specifically?
Martin
----- Original Message -----
From: "MedVisual Image Inc" <me...@yahoo.com>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Thursday, April 03, 2003 10:15 PM
Subject: ant path and file name


>
> Dear Sir::
>
> I need to know the exact path and file name for ant running on windows
2000.
>
> I downloaded some but wrong.
>
>
>
> Thank you for your help.
>
> MedV image
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Tax Center - File online, calculators, forms, and more

Re: ant path and file name

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
On Fri, 4 Apr 2003 03:15 pm, MedVisual Image Inc wrote:
> Dear Sir::
>
> I need to know the exact path and file name for ant running on windows
> 2000.
>
> I downloaded some but wrong.
>
>

Read this document

http://ant.apache.org/manual/install.html#installing

-- 
Conor MacNeill
Blog: http://codefeed.com/blog/


ant path and file name

Posted by MedVisual Image Inc <me...@yahoo.com>.
Dear Sir::

I need to know the exact path and file name for ant running on windows 2000.

I downloaded some but wrong.

 

Thank you for your help.

MedV image



---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more

Re: Tomcat JSPC Precompile using Ant - unique jsp name problem

Posted by Rob Moore <ro...@yahoo.com>.
Make sure to point the uriroot to your webapp's dir. So if you declared
webapps.dir as pointing to your base directory, such as webapps under
Tomcat, and webapp.name assigned the value of your webapp directory (or
context) then you'd have something like the example I provided in the last
post. The context dir has to have a WEB-INF directory beneath it.

If that still doesn't work, post your ant build info (such as the jasper2
tag) in your reply.

Rob




Re: Tomcat JSPC Precompile using Ant - unique jsp name problem

Posted by jo...@fwd.at.
Hi Rob,

I have the following config:
*) ant 1.5.2
*) catalina-ant.jar copied from tomcat-4.1.24\server\catalina-ant.jar

If I compile the jsps produced by jasper2, I still get the following 
error:
compile:
    [javac] Compiling 12 source files to E:\build\WEB-INF\classes
    [javac] E:\esvdevelop\devapp\forms\src\kbgverzicht\final_jsp.java:11: 
duplicate class: org.apache.jsp.final_jsp
    [javac] public class final_jsp extends HttpJspBase {

I think the package/class name is causing the trouble. Isn't there an 
option to include the directory name inside the class/package name? 
Wouldn't this resolve the trouble easily?

thx alot
Johannes




"Rob Moore" <ro...@yahoo.com> 
Sent by: news <ne...@main.gmane.org>
03.04.2003 16:42
Please respond to
"Ant Users List" <us...@ant.apache.org>


To
user@ant.apache.org
cc

Subject
Re: Tomcat JSPC Precompile using Ant - unique jsp name problem






FWIW, I tried using the Ant task included with 4.1.24 and it works very
well.

Take a look at:

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jasper/docs/api/org/apache/j

asper/JspC.html

It does have some drawbacks (like you can't use classpathref, apparently),
but it is the closest I've found to getting the desired result. At any 
rate,
it behaves well WRT packages.

P.S. Here's the relevant section from the docs:

 <taskdef classname="org.apache.jasper.JspC" name="jasper2" >
        <classpath>
            <pathelement location="${java.home}/../lib/tools.jar"/>
            <fileset dir="${ENV.CATALINA_HOME}/server/lib">
                <include name="*.jar"/>
            </fileset>
            <fileset dir="${ENV.CATALINA_HOME}/common/lib">
                <include name="*.jar"/>
            </fileset>
            <path refid="myjars"/>
         </classpath>
    </taskdef>

    <jasper2 verbose="0"
             package="my.package"
             uriroot="${webapps.dir}/${webapp.name}"
             webXmlFragment="${build.dir}/generated_web.xml"
 outputDir="${webapp.dir}/${webapp.name}/WEB-INF/src/my/package"
/>




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org



Re: Tomcat JSPC Precompile using Ant - unique jsp name problem

Posted by Rob Moore <ro...@yahoo.com>.
FWIW, I tried using the Ant task included with 4.1.24 and it works very
well.

Take a look at:

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jasper/docs/api/org/apache/j
asper/JspC.html

It does have some drawbacks (like you can't use classpathref, apparently),
but it is the closest I've found to getting the desired result. At any rate,
it behaves well WRT packages.

P.S. Here's the relevant section from the docs:

 <taskdef classname="org.apache.jasper.JspC" name="jasper2" >
        <classpath>
            <pathelement location="${java.home}/../lib/tools.jar"/>
            <fileset dir="${ENV.CATALINA_HOME}/server/lib">
                <include name="*.jar"/>
            </fileset>
            <fileset dir="${ENV.CATALINA_HOME}/common/lib">
                <include name="*.jar"/>
            </fileset>
            <path refid="myjars"/>
         </classpath>
    </taskdef>

    <jasper2 verbose="0"
             package="my.package"
             uriroot="${webapps.dir}/${webapp.name}"
             webXmlFragment="${build.dir}/generated_web.xml"
             outputDir="${webapp.dir}/${webapp.name}/WEB-INF/src/my/package"
/>