I run the Jetty server and try to register the servlet. This is how it works:
import com.crest.test.http.XmlParserServlet; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.ServletContextHandler; public class JettyServer { public static void start(int port) throws Exception { Server server = new Server(port); ServletContextHandler context = new ServletContextHandler( ServletContextHandler.SESSIONS); context.setContextPath("/"); context.setResourceBase("src/main/resources/pages"); server.setHandler(context); // Add dump servlet context.addServlet(XmlParserServlet.class, "/xml"); // Add default servlet context.addServlet(DefaultServlet.class, "/"); server.start(); server.join(); } } But if I delete the line from DefaultServlet, I get Error 500: StackOverFlow. Here is the servlet itself:
import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; public class XmlParserServlet extends DefaultServlet{ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.getRequestDispatcher("xml.jsp").forward(request, response); } } If that stakTreys also throw off, he just kilometer there. thanks for the help