Jetty “JSP Support not Configured” Error

In this example, we will show how to resolve an error which is frequently encountered if you are using Java Server Pages (JSP). Java Server Pages is a server side technology and it is used to create dynamic java web application. JSP can be considered an extension to servlet technology. We will use embedded jetty to show the error and how to resolve error JSP Support not configured . If you want to learn more about how to use standalone jetty to deploy servlets, you can read here

1. Environment

In this example, we will use following environment:

  • Eclipse Kepler 4.3
  • Jetty Version 9.2.15
  • Java version 7
  • Java Servlet library – servlet-api-3.1
  • Maven 3.0.4

2. Jetty – JSP Support Not Configured Example

2.1 Outline of example

In this example we will create a maven project with an embedded jetty. We will write a JSP page which will run on embedded jetty. We will show the error JSP Not Configured and then we will show how to resolve this error by configuring JSP in embedded jetty. At the end, we will also discuss why standalone jetty was not used for this example and show what ways we can configure JSP in standalone jetty.

2.2 Create a Maven Project

Here are the steps to create a Maven Project in eclipse:

2.2.1. Create a new Maven project

As shown in below screenshot, create a new maven project. Fill in the detail with GroupId as com.javacodegeeks.example and ArtifactId as jettyjspconfiguration-example

New Maven Project
New Maven Project

2.2.2 Modify pom.xml file

POM is a Project Object Model and it is an xml file in Maven project. The file contains the information related to project and configuration details used by Maven to build the project. We will add some dependencies like jetty server, jetty-webapp and jetty-annotations. These dependencies are needed to run our web application on embedded jetty server. Once we have added these dependencies, our pom.xml file will look like as shown below:

<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">

2.2.3 Configure Web Application

Create a WEB-INF folder under src/main/webapp and add web.xml file. The content of the file will be like below:

<web-app xmlns="" xmlns:xsi=""
	<display-name>Jetty JSP Configuration Example</display-name>

2.2.4 Simple JSP Application

Now we will write a simple JSP web page and Java code to run our embedded jetty server. Create a file index.jsp in eclipse project under project-name-> src -> main -> webapp. This is a simple JSP web page to print Hello Java Code Geeks . Our index.jsp will look like below:

<title>Sample JSP Page</title>
<%@ taglib uri="" prefix="c"%> 

	<c:out value="Jetty JSP Configuration Example"></c:out>
	<br /> 
	<% System.out.println("Hello Java Code Geeks"); %>
	<div align="center" style="margin-top: 50px;">
        <form id="loginForm">
            Please enter your Username:  <input type="text" name="username" size="20px"> <br>
            Please enter your Password:  <input type="text" name="password" size="20px"> <br><br>
			<input type="submit" value="submit">

We will write our java code to run jetty server. Let’s create java source file under src->main->java as shown below:

package com.javacodegeeks.example;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;

public class JettyJSPConfiguration {

	public static void main(String[] args) {
		Server server = new Server(8580);
		WebAppContext ctx = new WebAppContext();
		try {
		} catch (Exception e) {			


2.2.5 Run our example

Now once we run from eclipse, we can access the web application in browser at port 8580. Once the server is started, let’s go to browser and access http://localhost:8580/jettyjspconfiguration-example/index.jsp and we will get below error

Jetty  JSP Support Not Configured Error
Jetty JSP Support Not Configured Error

3. How to configure JSP Support

To fix our error Jetty JSP Support Not Configured , we will configure JSP support in our embedded jetty server. In our pom.xml, we will add apache-jsp dependency to handle JSP along with jstl dependency to handle JSP tag library. This will look like below:


We will do following changes in our Java source code to support JSP configuration for an embedded jetty. We will need to include jstl jar in building our application, so compiler can recognize jsp tags.

  1. org.eclipse.jetty.webapp.FragmentConfiguration processes all WEB-INF/web-fragment.xml files.
  2. We can extend the support of container by adding some extra configurations which will be needed to deploy a webapp. is used to create environment for webapp which is applied through WEB-INF/jetty-env.xml in a standalone jetty.
  3. will support JNDI aspects of WEB-INF/web.xml.
  4. We will use org.eclipse.jetty.annotations.AnnotationConfiguration to scan container and webapp jars looking for annotations related to WebServlet, WebFilter or WebListener.
  5. org.eclipse.jetty.webapp.JettyWebXmlConfiguration is used to look for xml configuration in WEB-INF.

It is important to note how these configurations are added in server classlist. This is how we will add those configurations through code:

		org.eclipse.jetty.webapp.Configuration.ClassList classlist = org.eclipse.jetty.webapp.Configuration.ClassList.setServerDefault(server);
        classlist.addAfter("org.eclipse.jetty.webapp.FragmentConfiguration", "", "");
        classlist.addBefore("org.eclipse.jetty.webapp.JettyWebXmlConfiguration", "org.eclipse.jetty.annotations.AnnotationConfiguration");

4. Run the web application

Once we are done with changes to java source code, we can run our project from eclipse and it will start our embedded jetty server. We will see the output of our JSP file in browser and also Hello Java Code Geeks in console of eclipse.

jetty jsp configuration example output
jetty jsp configuration example output

5. Standalone Jetty Server

If you are using jetty version 9.2.15 v20160210, jsp is by default enabled. In $jetty.base/start.d/jsp.ini file has following settings to enable jsp --module=jsp and jsp-impl=apache

6. Conclusion

In this example, we showed how to resolve the error jetty JSP support not configured by configuring jsp for embedded-jetty server.

7. Download the eclipse project

This was an example to configure JSP on an embedded-jetty.

You can download the full source code of this example here:

8. Related Articles

Following articles were referred in developing this example:

  1. Configuring JSP
  2. Embedded Jetty
  3. Jetty-JSP-Example

Yogesh Mali

Yogesh currently lives in Minneapolis and works as a Senior Software Engineer. He has a masters degree in Computer Science from University of Minnesota, Twin Cities. At graduate school, he did research in programming languages because of his love for functional and object oriented programming. Currently he delves into more details of Java, web development and security. Previously he worked as a product manager to create web application for health insurance brokers. In his free time, he listens to music and writes fictional stories.
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Newest Most Voted
Inline Feedbacks
View all comments
5 years ago

Yogesh, thank you very mach! Useful for me!

4 years ago

You published here a good and complete example of a JSP project. It’s really helpful to me!

Thank you very much!

Back to top button