Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
qq254963746 committed Apr 18, 2017
2 parents 99b4746 + 1535f55 commit c9732cf
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,23 @@ public static void main(String[] args) {
port = "8081";
}

String contextPath = conf.getProperty("contextPath");
if (contextPath == null || contextPath.trim().equals("")) {
contextPath = "/";
}

Server server = new Server(Integer.parseInt(port));
WebAppContext webapp = new WebAppContext();
webapp.setWar(confPath + "/war/lts-admin.war");
webapp.setContextPath(contextPath);
Map<String, String> initParams = new HashMap<String, String>();
initParams.put("lts.admin.config.path", confPath + "/conf");
webapp.setInitParams(initParams);
server.setHandler(webapp);
server.setStopAtShutdown(true);
server.start();

System.out.println("LTS-Admin started. http://" + NetUtils.getLocalHost() + ":" + port + "/index.htm");
System.out.println("LTS-Admin started. http://" + NetUtils.getLocalHost() + ":" + port + (contextPath == "/" ? "" : contextPath) + "/index.htm");

} catch (Exception e) {
e.printStackTrace();
Expand Down

0 comments on commit c9732cf

Please sign in to comment.