title: Embedded Jetty Server - NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
body: <p>I've have the following code to use an embedded Jetty server alongside a simple servlet and .jsp webpage.  However, after compiling and running the code:</p>
  
  <pre><code>javac -cp lib/servlet-api.jar:lib/jetty-all.jar com/test/MyServlet.java 
  javac -cp lib/servlet-api.jar:lib/jetty-all.jar com/test/ServerMain.java 
  java -cp .:lib/servlet-api.jar:lib/jetty-all.jar com/test/ServerMain
  </code></pre>
  
  <p>I get an error:</p>
  
  <pre><code>INFO:oejw.StandardDescriptorProcessor:main: NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
  </code></pre>
  
  <p>And navigating to /index.jsp gives a 500 error.</p>
  
  <pre><code>HTTP ERROR 500
  Problem accessing /index.jsp. 
  Reason:
  JSP support not configured
  </code></pre>
  
  <p>I've read this <a href="https://stackoverflow.com/questions/3521654/missing-jsp-support-in-jetty-or-confusing-log-message">post</a> but I don't think the solution applies here because I'm running Jetty embedded rather than using the start.jar.</p>
  
  <p>How can I resolve this error so that the server will run and serve .jsp pages successfully?</p>
  
  <p><strong>ServerMain.java</strong></p>
  
  <pre><code>package com.test;
  
  import org.eclipse.jetty.server.Server;
  import org.eclipse.jetty.webapp.WebAppContext;
  
  public class ServerMain {
  
      public static void main(String[] args) throws InterruptedException {
  
          Server server = new Server(8080);
          WebAppContext webApp = new WebAppContext();
          webApp.setDescriptor("web.xml");
          webApp.setResourceBase("");
          webApp.setParentLoaderPriority(true);
          server.setHandler(webApp);
  
          try {
              server.start();
          } catch (Exception e) {
              e.printStackTrace();
              System.exit(-1);
          }
          server.join();
      }
  }
  </code></pre>
  
  <p><strong>MyServlet.java</strong></p>
  
  <pre><code>package com.test;
  
  import java.io.IOException;
  import java.util.Properties;
  
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  public class MyServlet extends HttpServlet {
      @Override
      public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
  
          resp.setContentType("text/plain");
          resp.getWriter().println("Hello, this is a testing servlet. \n\n");
          Properties p = System.getProperties();
          p.list(resp.getWriter());
  
      }
  }
  </code></pre>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>   &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;!DOCTYPE web-app PUBLIC "-//Oracle Corporation//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"&gt;
  
  &lt;web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5"&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;MyServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;com.test.MyServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;MyServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/test&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>This is my project structure:</p>
  
  <pre><code>webapp
  ----com
      ----test
          ----MyServlet.java
          ----ServerMain.java
          ----index.jsp
          ----web.xml
  ----lib
      ----jetty-all.jar
      ----servlet-api.jar  
  </code></pre>