Hi,
I've been toying with spark 2.2 and trying to deploy a small war webapp with latest tomcat8.
I'm trying to access the servlet context and paths using getServletContext(), which can only be used if the class extends HttpServlet.
I was hoping to write something like this:
public class Main extends HttpServlet implements SparkApplication {
public void init() {
System.out.println(getServletContext()); // this does not work the filter will never start inside tomcat8
get("/hello", (request, response) -> {
return "Hello World!";
});
}
}
Can someone help me untangle this problem? I need this to be able to open some local files within the application, once deployed and expanded in tomcat8/webapps.
Thanks in advance.
Christian