Tag Archives: precompilation

How to prevent JSP recompilation in WebLogic Server

My previous post explains how to precompile JSPs with the WebLogic wlappc Ant task. This is a follow-up explaining how to prevent WebLogic Server to recompile the JSPs completely.

Add the following snippet to the weblogic.xml of your WAR.

<jsp-descriptor>
    <page-check-seconds>-1</page-check-seconds>
    <precompile>false</precompile>
</jsp-descriptor>

Add the following snippet to the web.xml of your WAR.

<servlet>
    <servlet-name>JSPClassServlet</servlet-name>
    <servlet-class>weblogic.servlet.JSPClassServlet</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>JSPClassServlet</servlet-name>
    <url-pattern>*.jsp</url-pattern>
</servlet-mapping>

Read more »

How to precompile JSPs with the WebLogic wlappc Ant task

The following Ant snippet allows you to precompile your JSPs (and more) for WebLogic Server.

<!-- Define some properties -->
<property name="weblogic.server.dir" value="C:/Oracle/Middleware"/>
<property name="weblogic.server.lib.dir" value="${weblogic.server.dir}/wlserver_10.3/server/lib"/>
<property name="pathTo.weblogic.jar" value="${weblogic.server.lib.dir}/weblogic.jar"/>
<property name="war.src.dir" value="${basedir}/build/war"/>
<property name="war.dist.dir" value="${basedir}/dist"/>

<!-- Add the WebLogic appc task definition to the current project -->
<taskdef name="wlappc" classname="weblogic.ant.taskdefs.j2ee.Appc" classpath="${pathTo.weblogic.jar}"/>

<!-- Set up the classpath for the WebLogic appc task -->
<path id="wlappc.classpath">
    ...
</path>

<!-- Compile the source of your WAR file with weblogic.appc -->
<target name="wlCompileWarSrc">
    <wlappc source="${war.src.dir}" classpathref="wlappc.classpath" keepgenerated="true"
            debug="true" linenumbers="true" verbose="true" verbosejavac="true"/>
</target>

<!-- Make the project WAR -->
<target name="war" depends="wlCompileWarSrc">
    ...
</target>

Read more »