What is the best way to precompile JSP with Ant

I am trying to find the best way to use Ant to precompile JSPs that will be deployed to an Oracle application server. Although I am deploying an Oracle application server, I would like to avoid using the Oracle Ant version.

+5
source share
2 answers

The Oracle JSP compiler is available in your oc4j program at ORACLE_HOME / j2ee / home / jsp / bin / ojspc

Assuming your classpath is correct, on the compand line you run:

ojspc your.war

WEB-INF/lib, JSP. , JSP MAIN_MODE "JUSTRUN", JSP. JUSTRUN , , OC4J .jsp .

<servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>oracle.jsp.runtimev2.JspServlet</servlet-class>
    <init-param>
      <param-name>main_mode</param-name>
      <param-value>justrun</param-value>
    </init-param>
</servlet>

ojspc ANT, Oracle.

ANT

<oracle:compileJsp file="dist/war/before-${app}war"
        verbose="false"
        output="dist/war/${app}.war" />

:

<project name="your-name" default="compile" basedir="."  xmlns:oracle="antlib:oracle">
...
</project>

02.22.2011 ojspc oracle: compileJsp Task, JSPS .

 <!-- Now Precompile the War File (see entry in <project> tag ) -->
    <java jar="${env.ORACLE_HOME}/j2ee/home/ojspc.jar" classpathref="jspPreCompileClassPath" fork="true">
        <arg value="-addClasspath"/>
        <arg pathref="classpath"/>
        <arg line="'${dist}/war/a-war-file.war'"/>
    </java>

jspPreCompileClassPath :

  <path id="jspPreCompileClassPath">
    <path location="${env.ORACLE_HOME}/j2ee/home/lib/pcl.jar"/>
    <path location="${env.ORACLE_HOME}/j2ee/home/lib/ojsp.jar"/>
    <path location="${env.ORACLE_HOME}/j2ee/home/lib/oc4j-internal.jar"/>
    <path location="${env.ORACLE_HOME}/j2ee/home/lib/servlet.jar"/>
    <path location="${env.ORACLE_HOME}/j2ee/home/lib/commons-el.jar"/>
    <path location="${env.ORACLE_HOME}/j2ee/home/lib/bcel.jar"/>
    <path location="${env.ORACLE_HOME}/lib/xmlparserv2.jar"/>
    <path location="${env.ORACLE_HOME}/j2ee/home/lib/oc4j-schemas.jar"/>
    <path location="${env.ORACLE_HOME}/j2ee/home/jsp/lib/taglib/ojsputil.jar"/>
  </path>
+7

, Oracle Ant, , , oracle Ant. , . apache Ant, - apache, Oracle Ant Oracle JSP Oracle.

+2

All Articles