Skip to content

Commit

Permalink
Merge pull request #288 from hadashi/1.2.x
Browse files Browse the repository at this point in the history
Play nicely with servlet containers class loader.
  • Loading branch information
guillaumebort committed Aug 25, 2011
2 parents 711eb01 + b90a677 commit c9b803b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions framework/src/play/server/ServletWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public class ServletWrapper extends HttpServlet implements ServletContextListene
private static boolean routerInitializedWithContext = false;

public void contextInitialized(ServletContextEvent e) {
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
String appDir = e.getServletContext().getRealPath("/WEB-INF/application");
File root = new File(appDir);
final String playId = e.getServletContext().getInitParameter("play.id");
Expand All @@ -81,6 +82,8 @@ public void contextInitialized(ServletContextEvent e) {
if (isGreaterThan(e.getServletContext(), 2, 4)) {
loadRouter(e.getServletContext().getContextPath());
}

Thread.currentThread().setContextClassLoader(oldClassLoader);
}

public void contextDestroyed(ServletContextEvent e) {
Expand Down

0 comments on commit c9b803b

Please sign in to comment.