package org.baswell.routes;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class RoutesServlet extends HttpServlet
{
  private RoutesEntry routesEntry;

  @Override
  public void init(ServletConfig config) throws ServletException
  {
    super.init(config);
    routesEntry = new RoutesEntry();
  }


  @Override
  protected void service(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException
  {
    if (!routesEntry.process(servletRequest, servletResponse))
    {
      servletResponse.sendError(404);
    }
  }
}
@@ -26,44 +26,8 @@
 s;%0A%0A
-import javax.servlet.ServletConfig;%0A
 impo
@@ -61,16 +61,16 @@
 eption;%0A
+
 import j
@@ -281,16 +281,23 @@
 private 
+static 
 RoutesEn
@@ -303,131 +303,8 @@
 ntry
- routesEntry;%0A%0A  @Override%0A  public void init(ServletConfig config) throws ServletException%0A  %7B%0A    super.init(config);%0A   
  rou
@@ -337,13 +337,8 @@
 ();%0A
-  %7D%0A%0A
 %0A  @
@@ -581,15 +581,15 @@
 e.se
-ndError
+tStatus
 (404

Make RoutesEntry static incase servlet is instianted for each request.