tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <jaka...@trollingers.com>
Subject Re: [PROPOSAL] - jasper2 JspC --servlet option
Date Fri, 23 Aug 2002 19:38:28 GMT
right now it only works if you do not have 2 jsp files with the 
same name, or are still going through Jaspers magic classloader 
to call the servlets.  If you want to deploy the servlets 
without the jsp pages (ie go through the default servlet) then 
if you have to jsp pages with the same name they will have the 
same class file name therefor the classloader for servlets will 
only load one of them.

John


> Ok, I'm confused - I thought that already works.
> 
> I'm actually using this feature - jspc generates servlets and 
> web.xml fragments.
> 
> Is there something missing ? 
> 
> What I use ( I already posted that ) is:
> 
>   <target name="jspc" depends="..." >
>     <mkdir dir="${build.dir}/src/myPackage" />
>     <taskdef classname="org.apache.jasper.JspC" name="jasper2" 
>
>       <classpath>
>         <pathelement location="${java.home}/../lib/tools.jar"/>
>         <fileset dir="${tomcat.home}/server/lib">
>           <include name="*.jar"/>
>         </fileset>
>         <fileset dir="${tomcat.home}/common/lib">
>           <include name="*.jar"/>
>         </fileset>
>         <pathelement location="${build.dir}/classes"/>
>         <path refid="myjars"/>
>       </classpath>
>     </taskdef>
>     
>     <jasper2 verbose="0" 
>              package="myPackage"
>              compile="true"
>              validateXml="false"
>              uriroot="${my.webapp.dir}"
>              webXmlFragment="${build.dir}/generated_web.xml" 
>               outputDir="${build.dir}/src/myPackage" />
>     
>     <loadfile property="generated_web.xml" 
>               srcFile="${build.dir}/generated_web.xml"  />
>     <replace file="${my.webapp.dir}/WEB-INF/web.xml" 
>              token="<!--GENERATED_JSPS-->" 
>              value="${generated_web.xml}" />
> 
>     <javac destdir="${build.dir}/classes" 
>            optimize="off"
>            debug="on"
>            srcdir="${build.dir}/src" >
>       <classpath>
>         <pathelement location="${java.home}/../lib/tools.jar"/>
>         <fileset dir="${tomcat.home}/server/lib">
>           <include name="*.jar"/>
>         </fileset>
>         <fileset dir="${tomcat.home}/common/lib">
>           <include name="*.jar"/>
>         </fileset>
>         <pathelement location="${build.dir}/classes"/>
>         <path refid="myjars"/>
>       </classpath>
>       <include name="myPackage/**" /> 
>     </javac>
>     
>     <jar jarfile="${my.webapp.dir}/WEB-INF/lib/my-jsp.jar" >
>       <fileset dir="${build.dir}/classes">
>         <include name="myPackage/**"/>
>       </fileset>
>     </jar>
>   </target>
> 
> Costin
> 
> 
> On Fri, 23 Aug 2002, John Trollinger wrote:
> 
> > This option will compile the jsp pages with a package 
structure so that
> > they can be deployed as servlets rather than jsp pages. (it 
can also be
> > used with the -p option that will give it a base package 
name) 
> > 
> > /index.jsp --> <base package name>.index_jsp
> > /subdir/index.jsp --> <base package name>.subdir.index_jsp 
> > 
> > Let me know if anyone likes this, if so I will go ahead and 
do the impl.
> > 
> > John Trollinger
> > 
> > 
> > --
> > To unsubscribe, e-mail:   <mailto:tomcat-dev-
unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:tomcat-dev-
help@jakarta.apache.org>
> > 
> > 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:tomcat-dev-
unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-dev-
help@jakarta.apache.org>
> 





--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message