Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


There are several options for modifying the Jasper JSP servlet configuration. Which is most suitale suitable will depend on your requirements.


You can make a copy of the webdefault.xml shipped with jetty, apply your changes and use it instead of the shipped version. The example below shows
how to do this when using the maven jetty plugin.

title"Overiding webdefault.xml"
Code Block

If you're using jetty standalone, and you want to change the jsp settings for just one or a few of your webapps, then copy the $JETTY_HOME/etc/webdefault.xml file somewhere, modify it, and then use a context xml file to set this file as the webdefaults for your webapp. Here's a snippet:

Code Block

<Configure class="org.eclipse.jetty.webapp.WebAppContext">

  <Set name="contextPath">/foo</Set>
  <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/foobar.war</Set>
  <Set name="defaultsDescriptor">/home/smith/dev/webdefault.xml</Set>

Configure JSP Servlet in web.xml

Another option is to add an ebtry entry for the Jasper JSP servlet to the web.xml file of your webapp.
You can use the entry in webdefault.xml as a starting point.

title"Configuring JSP Servlet in web.xml"
Code Block
 <servlet id="jsp">

  <servlet id="my-servlet">
Contact the core Jetty developers at
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery