You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Scott Edwards <SE...@Fasturn.com> on 2002/12/14 00:40:34 UTC

Precompiling same name jsps

We have successfully compiled our jsp pages into java files. However, in
several cases we have jsp pages in different directories with the same name.
When we run the jspc task from within Ant 1.5.1, it does not append the
directory path to the package name. As such, javac throws exceptions
regarding duplicate classnames when we try to compile the java files into
class files.

Outside of renaming the jsp files, has anyone encountered this issue and
have a solution? Or are we just missing something.

Thanks in advance for any assistance,

-Scott


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Precompiling same name jsps

Posted by Billy Ng <kw...@earthlink.net>.
Hi Scott, I still cannot precompile my jsp files.  Attached is my jspc
portion.  It throws me exception and fails.  If you could, would you please
shared your build.xml with me.

Thanks!

Billy Ng

  [jasperc] java.lang.ArrayIndexOutOfBoundsException: 98
  [jasperc]     at org.apache.jasper.JspC.locateUriRoot(JspC.java:616)
  [jasperc]     at org.apache.jasper.JspC.execute(JspC.java:747)
  [jasperc]     at org.apache.jasper.JspC.main(JspC.java:810)
  [jasperc] Exception in thread "main"


  <!-- compile the java file to the deploying build directory -->
  <target name="compile" depends="copy">
   <javac destdir="${build.classes}" debug="on">
    <src path="${src}" />
    <classpath refid="app.classpath" />
   </javac>
  </target>

  <!-- create reusable classpath -->
  <taskdef name="jspc"
classname="org.apache.tools.ant.taskdefs.optional.jsp.JspC"/>
   <path id="1">
    <pathelement location="${build.webinf}/classes" />
     <fileset dir="${build.classes}">
      <include name="**/*.java" />
     </fileset>
     <fileset dir="${lib}">
      <include name="**/*.jar" />
     </fileset>
     <fileset dir="${tomcat.bin}">
      <include name="*.jar" />
     </fileset>
     <fileset dir="${tomcat}/server/lib">
      <include name="*.jar" />
     </fileset>
     <fileset dir="${tomcat}/common/lib">
      <include name="*.jar" />
     </fileset>
     <fileset dir="/java/lib">
      <include name="*.jar" />
     </fileset>
   </path>

   <!-- cleanJSPBuildDirectory -->
   <target name="cleanJSPBuildDir">
     <delete includeEmptyDirs="true" quiet="false" failonerror="false">
       <fileset dir="gensrc" />
     </delete>
   </target>

   <!-- createJSPBuildDir -->
   <target name="createJSPBuildDir">
     <mkdir dir="gensrc" />
   </target>

   <!-- Jspc -->
   <target name="buildJSP" depends="cleanJSPBuildDir, createJSPBuildDir">
       <jspc srcdir="${ui}" destdir="gensrc">
          <classpath refid="1"/>
         <include name="**/*.jsp" />
       </jspc>
   </target>




----- Original Message -----
From: "Scott Edwards" <SE...@Fasturn.com>
To: <to...@jakarta.apache.org>
Sent: Friday, December 13, 2002 3:40 PM
Subject: Precompiling same name jsps


> We have successfully compiled our jsp pages into java files. However, in
> several cases we have jsp pages in different directories with the same
name.
> When we run the jspc task from within Ant 1.5.1, it does not append the
> directory path to the package name. As such, javac throws exceptions
> regarding duplicate classnames when we try to compile the java files into
> class files.
>
> Outside of renaming the jsp files, has anyone encountered this issue and
> have a solution? Or are we just missing something.
>
> Thanks in advance for any assistance,
>
> -Scott
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>