Google
 
 
Home arrow Other Articles arrow Pre compile weblogic jsp pages

Main Menu
 Home
 Linux Articles
 FreeBSD Articles
 Apache Articles
 Perl Articles
 Other Articles
 Program Downloads
 Free Books
 News
 The Web Links
 Contact Us

Most Read
Automating SFTP using expect
FreeBSD PPTP VPN
Shorewall Router on Linux
SnortShorwall - Using Snort And Shorewall Together
Shorewall Stand Alone Firewall

Polls
Favorite Linux/BSD
Fedora
Mandrake
Debian
Slackware
Gentoo
Suse
FreeBSD
Other
  

Syndicate
Latest news direct to your desktop
RSS

Login Form
Username

Password

Remember me
Forgotten your password?
No account yet? Create one

Members Online
 Linux-BSD-Central Has a Total of 701 Members   Members (701) # Online
 We have 10 Guests Online. Guests 10
 We have 0 Users Online. Users 0

Online Users
No Users Online

Statistics
OS: Linux w
PHP: 5.2.9
MySQL: 5.0.91-community
Time: 14:33
Members: 701
Hits: 1324381
News: 277
WebLinks: 15



-->

Pre compile weblogic jsp pages   PDF  Print  E-mail 
Contributed by Chad Brandt  
Monday, 20 June 2005

In a production application you may want to have the jsp's in the app pre-compiled rather than taking the performance hit the first time the page loads. Weblogic server gives you a way to compile your jsp's at build time and package the compiled classes in your ear file.

This is  a sample ant build script that shows how to use an Ant target to compile jsp pages and build the war file containing the compiled jsps

 <?xml version="1.0" encoding="UTF-8"?>
<project name="precompile" default="deploy" basedir=".">


    <property name="basedir" value="."/>
    <property name="lib" value="${basedir}/lib"/>
    <property name="jsp" value="${basedir}/jsp"/>
    <property name="war.file" value="${basedir}/precompile.war"/>
    <property name="build.dir" value="${basedir}/build"/>
    <property name="build.classes" value="${build.dir}/classes"/>
    <property name="war.dir" value="${build.dir}/war"/>

    <path id="cp">
        <pathelement path="${build.classes}"/>
        <fileset dir="${lib}" includes="**/*.jar"/>
    </path>

    <target name="prepare">
        <mkdir dir="${build.classes}"/>
        <mkdir dir="${war.dir}"/>
    </target>
   
    <target name="jsp_precompile" depends="prepare">
        <java classname="weblogic.jspc" fork="yes" failonerror="true"
              output="${basedir}/results.jspc" dir="${jsp}">
            <jvmarg value="-Dweblogic.jsp.windows.caseSensitive=true"/>

            <arg line="-verbose -noTryBlocks -depend -compileAll -webapp ${war.dir} -d ${war.dir}/WEB-INF ."/>
            <classpath refid="cp"/>
        </java>
    </target>

  
    <target name="deploy" depends="jsp_precompile">
        
        <copy todir="${war.dir}">
            <fileset dir="${basedir}/jsp"/>
            <fileset dir="${basedir}/html"/>
        </copy>
       
        <copy todir="${war.dir}/WEB-INF">
            <fileset dir="${basedir}/etc"/>
        </copy>
        
         <jar jarfile="${war.file}" basedir="${war.dir}"/>

    </target>

    <target name="clean">
        <delete dir="${build.classes}"/>
        <delete dir="${war.dir}"/>
        <delete file="${war.file}"/>
    </target>
   
</project>

Comments

Write Comment
Name:Guest
Title:
BBCode:Web AddressEmail AddressBold TextItalic TextUnderlined TextQuoteCodeOpen ListList ItemClose List
Comment:



Powered by AkoComment 1.0 beta 2!




 
Google Ads



 

Check out TwistByte - The best mobile apps available For awesome Android and IPhone applications!!