Class WLJspc
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.MatchingTask
org.apache.tools.ant.taskdefs.optional.jsp.WLJspc
- All Implemented Interfaces:
- Cloneable,- SelectorContainer
Precompiles JSP's using WebLogic's JSP compiler (weblogic.jspc).
 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
   _dirName/_fileName.class for dirname/fileName.jsp   
 Limitation: It compiles the files through 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.
 
 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>
 - 
Field SummaryFields inherited from class org.apache.tools.ant.taskdefs.MatchingTaskfilesetFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionMaybe creates a nested classpath element.voidexecute()Run the task.protected StringreplaceString(String inpString, String escapeChars, String replaceChars) Replace occurrences of a string with a replacement string.protected voidScan the array of files and add the jsp files that need to be compiled to the filesToDo field.voidsetClasspath(Path classpath) Set the classpath to be used for this compilation.voidSet the directory containing the source jsp'svoidsetPackage(String packageName) Set the package under which the compiled classes govoidSet the directory containing the source jsp'sMethods inherited from class org.apache.tools.ant.taskdefs.MatchingTaskadd, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItemsMethods inherited from class org.apache.tools.ant.TaskbindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation
- 
Constructor Details- 
WLJspcpublic WLJspc()
 
- 
- 
Method Details- 
executeRun the task.- Overrides:
- executein class- Task
- Throws:
- BuildException- if there is an error.
 
- 
setClasspathSet the classpath to be used for this compilation.- Parameters:
- classpath- the classpath to use.
 
- 
createClasspathMaybe creates a nested classpath element.- Returns:
- a path to be configured.
 
- 
setSrcSet the directory containing the source jsp's- Parameters:
- dirName- the directory containing the source jsp's
 
- 
setDestSet the directory containing the source jsp's- Parameters:
- dirName- the directory containing the source jsp's
 
- 
setPackageSet the package under which the compiled classes go- Parameters:
- packageName- the package name for the classes
 
- 
scanDirScan the array of files and add the jsp files that need to be compiled to the filesToDo field.- Parameters:
- files- the files to scan.
 
- 
replaceStringReplace occurrences of a string with a replacement string.- Parameters:
- inpString- the string to convert.
- escapeChars- the string to replace.
- replaceChars- the string to place.
- Returns:
- the converted string.
 
 
-