Adapted to tomcat deployment