Posted By

bosshog on 08/20/12


Tagged


Versions (?)

Tomcat 7 emdedded


 / Published in: Java
 

How to embedded tomcat 7 java

  1. String webappDirLocation = "src/main/webapp/";
  2. Tomcat tomcat = new Tomcat();
  3. tomcat.setPort(8080);
  4.  
  5. tomcat.addWebapp("/jerseyTest", new File(webappDirLocation).getAbsolutePath());
  6.  
  7. tomcat.start();
  8. tomcat.getServer().await();

Report this snippet  

You need to login to post a comment.