ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Avik.Sengu...@dresdner-bank.com
Subject RE: Task for JSP compilation
Date Sat, 09 Sep 2000 14:07:21 GMT
OK, here it is. 

I have tested it on NT4/jdk1.2.2 and Solaris 5.7/jdk1.2.1. It probably needs
some more testing to ensure that nothing about my current environment has
crept it, specifically with regard to file paths. 

Also, i have been working with the last stable build and not the CVS stuff,
so I hope it wont break because of any recent changes. 

Sorry, i dont have any tool to generate diffs, so can i just append the
stuff. 

here is the change to my default.properties, in the optional tasks category
-------------------------------------------------------------
wljspc=org.apache.tools.ant.taskdefs.optional.WLJspc
-----------------------------------------------------------

Here is the documentation (present in the javadoc as well)
-----------------------------------------------------------
  Tested only on Weblogic 4.5.1 - NT4.0 and Solaris 5.7 
  
  required attributes
       src : root of source tree for JSP, ie, the document root for your
weblogic server
       dest : root of destination directory, what you have set as WorkingDir
in the weblogic properties
       package : start package name under which your JSP's would be compiled
  
  other attributes
      classpath
  
  A classpath should be set which contains the weblogic classes as well as
all application classes
  referenced by the JSP. The system classpath is also appended when the jspc
is called, so you may 
  choose to put everything in the classpath while calling Ant. However,
since presumably the JSP's will reference
  classes being build by Ant, it would be better to explicitly add the
classpath in the task
  
  The task checks timestamps on the JSP's and the generated classes, and
compiles
  only those files that have changed. 
  
  It follows the weblogic naming convention of putting classes in 
   <b> _dirName/_fileName.class for dirname/fileName.jsp   </b>
  
  Limitation: It compiles the files thru the Classic compiler only. 
  Limitation: Since it is my experience that weblogic jspc throws out of
memory error on being given too
              many files at one go, it is called multiple times with one jsp
file each. thus dont use it if u are in a hurry ..
              but since it builds incrementally, its not to bad. 
  
  <pre>
  example
  <target name="jspcompile" depends="compile">
    <wljspc src="c:\\weblogic\\myserver\\public_html"
dest="c:\\weblogic\\myserver\\serverclasses" package="myapp.jsp" >
 	 <classpath>
        	<pathelement location="${weblogic.classpath}" />
 	         <pathelement path="${compile.dest}" />
      	</classpath>
  
    </wljspc>
  </target>
  </pre>
---------------------------------------------------------

And finally, the java source is attached

 <<WLJspc.java>> 

> -----Original Message-----
> From:	KC Baltz [SMTP:KBaltz@responsenetworks.com]
> Sent:	Thursday, September 07, 2000 12:56 AM
> To:	'ant-dev@jakarta.apache.org'
> Subject:	RE: Task for JSP compilation
> 
> +1
> 
> K.C.

Mime
View raw message