diff options
author | Henri Sara <henri.sara@itmill.com> | 2010-05-24 13:44:14 +0000 |
---|---|---|
committer | Henri Sara <henri.sara@itmill.com> | 2010-05-24 13:44:14 +0000 |
commit | 7b3ff5dd63a7063e81c4432ff8358586bf46d290 (patch) | |
tree | a3be8b4a752841cfc4d88533083696c185f5fc2a /src/com/vaadin/launcher | |
parent | 5578b218eef1476176b5224f046f548c3d854592 (diff) | |
download | vaadin-framework-7b3ff5dd63a7063e81c4432ff8358586bf46d290.tar.gz vaadin-framework-7b3ff5dd63a7063e81c4432ff8358586bf46d290.zip |
#4568 DevelopmentServerLauncher port was hardcoded, parameter ignored
svn changeset:13328/svn branch:6.3
Diffstat (limited to 'src/com/vaadin/launcher')
-rw-r--r-- | src/com/vaadin/launcher/DevelopmentServerLauncher.java | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/com/vaadin/launcher/DevelopmentServerLauncher.java b/src/com/vaadin/launcher/DevelopmentServerLauncher.java index ef02f8817f..b7caa881b1 100644 --- a/src/com/vaadin/launcher/DevelopmentServerLauncher.java +++ b/src/com/vaadin/launcher/DevelopmentServerLauncher.java @@ -21,7 +21,7 @@ import com.vaadin.launcher.util.BrowserLauncher; */
public class DevelopmentServerLauncher {
- private final static String serverPort = "8888";
+ private final static int serverPort = 8888;
/**
* Main function for running Jetty.
@@ -59,6 +59,18 @@ public class DevelopmentServerLauncher { protected static String runServer(Map<String, String> serverArgs,
String mode) {
+ // Assign default values for some arguments
+ assignDefault(serverArgs, "webroot", "WebContent");
+ assignDefault(serverArgs, "httpPort", "" + serverPort);
+ assignDefault(serverArgs, "context", "");
+
+ int port = serverPort;
+ try {
+ port = Integer.parseInt(serverArgs.get("httpPort"));
+ } catch (NumberFormatException e) {
+ // keep default value for port
+ }
+
// Add help for System.out
System.out
.println("-------------------------------------------------\n"
@@ -69,17 +81,12 @@ public class DevelopmentServerLauncher { + serverPort
+ "\n-------------------------------------------------\n");
- // Assign default values for some arguments
- assignDefault(serverArgs, "webroot", "WebContent");
- assignDefault(serverArgs, "httpPort", serverPort);
- assignDefault(serverArgs, "context", "");
-
try {
final Server server = new Server();
final Connector connector = new SelectChannelConnector();
- connector.setPort(8888);
+ connector.setPort(port);
server.setConnectors(new Connector[] { connector });
final WebAppContext webappcontext = new WebAppContext();
@@ -97,8 +104,7 @@ public class DevelopmentServerLauncher { return null;
}
- return "http://localhost:" + serverArgs.get("httpPort")
- + serverArgs.get("context");
+ return "http://localhost:" + port + serverArgs.get("context");
}
/**
|