-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added rogerwlucas patch for static files - mitro-co/mitro#128 (comment)
- Loading branch information
Showing
3 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
diff --git a/mitro-core/java/server/src/co/mitro/core/server/Main.java b/mitro-core/java/server/src/co/mitro/core/server/Main.java | ||
index 7ff7b94..2abd624 100644 | ||
--- a/mitro-core/java/server/src/co/mitro/core/server/Main.java | ||
+++ b/mitro-core/java/server/src/co/mitro/core/server/Main.java | ||
@@ -50,6 +50,7 @@ import org.eclipse.jetty.server.Slf4jRequestLog; | ||
import org.eclipse.jetty.server.SslConnectionFactory; | ||
import org.eclipse.jetty.server.handler.HandlerCollection; | ||
import org.eclipse.jetty.server.handler.RequestLogHandler; | ||
+import org.eclipse.jetty.server.handler.ResourceHandler; | ||
import org.eclipse.jetty.servlet.ServletContextHandler; | ||
import org.eclipse.jetty.servlet.ServletHolder; | ||
import org.eclipse.jetty.util.component.LifeCycle; | ||
@@ -394,9 +395,15 @@ public class Main { | ||
requestLog.setLogTimeZone("UTC"); | ||
requestLogHandler.setRequestLog(requestLog); | ||
|
||
- // Install both the servlet handler and the logging handler | ||
+ // Handle static file requests | ||
+ ResourceHandler staticFiles = new ResourceHandler(); | ||
+ staticFiles.setDirectoriesListed(true); | ||
+ staticFiles.setWelcomeFiles(new String[]{"index.html"}); | ||
+ staticFiles.setResourceBase("html"); | ||
+ | ||
+ // Install the servlet handler, logging handler and static file support | ||
HandlerCollection handlers = new HandlerCollection(); | ||
- handlers.setHandlers(new Handler[]{context, requestLogHandler}); | ||
+ handlers.setHandlers(new Handler[]{context, requestLogHandler, staticFiles}); | ||
|
||
OldJsonData ojd = OldJsonData.createFromStream( | ||
Main.class.getResourceAsStream("service_list.json")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<HTML> | ||
<HEAD> | ||
<TITLE>Password verified</TITLE> | ||
</HEAD> | ||
<BODY BGCOLOR="FFFFFF"> | ||
<HR> | ||
<P><CENTER>Thank you, your password has been verified.</CENTER> | ||
<HR> | ||
</BODY> | ||
</HTML> |