Commits

plightbo  committed 73e9086
  • Participants
  • Parent commits 7f4aff3

Comments (0)

Files changed (1)

File src/java/com/opensymphony/webwork/quickstart/JettyServer.java

 
 import java.util.List;
 import java.util.Map;
+import java.io.File;
 
 /**
  * To start a Jetty server used by the QuickStart application.
  */
 public class JettyServer {
+    /**
+     * The system property name used to specify a directory of webapps.
+     */
+    public static final String WEBAPPS_DIR_PROPERTY = "webapps.dir";
+
     public static void startServer(int port, String context, List pathPriority, Map paths, String resolver) throws Exception {
         try {
             Server server = new Server();
             ctx.setContextPath(context);
             server.addContext(null, ctx);
 
+            // Add in extra webapps dir (see WW-1319)
+            String webappsDir = System.getProperty(WEBAPPS_DIR_PROPERTY);
+            if (webappsDir != null && new File(webappsDir).exists()) {
+                server.addWebApplications(webappsDir);
+            }
+
             server.start();
         } catch (Exception e) {
             e.printStackTrace();