Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8379279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:08:12+00:00 2026-06-09T16:08:12+00:00

We are using jspc ant task to pre-compile JSP files into classes/(then package into

  • 0

We are using jspc ant task to pre-compile JSP files into classes/(then package into war)

Now we are switching to Jetty 8. According to the doc, there exists a maven plugin to do this. Do we have ant task to do the same?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:08:13+00:00Added an answer on June 9, 2026 at 4:08 pm

    Its best if you use the JSP libs that comes with the jetty distribution.

    Here’s an example, using jetty-distribution-8.1.5.v20120716

    <?xml version="1.0" ?>
    <project name="AntExample1" default="war">
    
        <property name="jetty.home" value="${user.home}/code/intalio/distros/jetty-distribution-8.1.5.v20120716" />
    
        <path id="compile.jspc">
            <fileset dir="${jetty.home}">
                <include name="lib/servlet-api-*.jar" />
                <include name="lib/jsp/*.jar" />
            </fileset>
        </path>
    
        <path id="compile.classpath">
            <fileset dir="WebContent/WEB-INF/lib">
                <include name="*.jar" />
            </fileset>
            <path refid="compile.jspc" />
        </path>
    
        <target name="jspc" depends="compile">
            <taskdef classname="org.apache.jasper.JspC" name="jasper2" classpathref="compile.jspc" />
            <jasper2 validateXml="false"
                uriroot="WebContent"
                addWebXmlMappings="true"
                webXmlFragment="WebContent/WEB-INF/generated_web.xml"
                compilerSourceVM="1.6"
                compilerTargetVM="1.6"
                outputDir="build/gen-src"
                verbose="9" />
        </target>
    
        <target name="init">
            <mkdir dir="build/classes" />
            <mkdir dir="build/gen-src" />
            <mkdir dir="dist" />
            <copy todir="build/gen-src">
                <fileset dir="src" includes="**/*.java" />
            </copy>
        </target>
    
        <target name="compile" depends="init">
            <javac destdir="build/classes" debug="true" srcdir="build/gen-src">
                <classpath refid="compile.classpath" />
            </javac>
        </target>
    
        <target name="war" depends="jspc">
            <war destfile="dist/AntExample.war" webxml="WebContent/WEB-INF/web.xml">
                <fileset dir="WebContent" />
            <classes dir="build/classes" />
            </war>
        </target>
    
        <target name="clean">
            <delete dir="dist" />
            <delete dir="build" />
        </target>
    
    </project>
    

    Update: April 8, 2013

    Pushed an example project with this build to github.

    https://github.com/jetty-project/jetty-example-jspc-ant

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to compile our jsp files using jspc within gradle but am getting
Using C#.NET, i wrote a toolbar which is stored now into toolbar.cs file. I
Using ASIHTTPRequest, I downloaded a zip file containing a folder with several audio files.
Using mercurial, I've run into an odd problem where a line from one committer
Using IOS, I am trying to integrate the LinkedIn into the application. The integration
is there a way to create web.xml file using ANT build.xml file ? I
Using a CSS image sprite, I'm creating an 'interactive' image where hovering over certain
Using a populated Table Type as the source for a TSQL-Merge. I want to
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using SQL Server 2008 R2 we are looking for a way to select the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.