@@ -45,7 +45,7 @@ public SteveAppContext() {
4545 springContext .scan ("de.rwth.idsg.steve.config" );
4646 }
4747
48- public HandlerCollection getHandlers () throws IOException {
48+ public HandlerCollection getHandlers () {
4949 HandlerList handlerList = new HandlerList ();
5050 handlerList .setHandlers (
5151 new Handler []{
@@ -55,7 +55,7 @@ public HandlerCollection getHandlers() throws IOException {
5555 return handlerList ;
5656 }
5757
58- private Handler getWebApp () throws IOException {
58+ private Handler getWebApp () {
5959 if (CONFIG .getJetty ().isGzipEnabled ()) {
6060 return enableGzip (initWebApp ());
6161 } else {
@@ -74,10 +74,10 @@ private Handler enableGzip(WebAppContext ctx) {
7474 return gzipHandler ;
7575 }
7676
77- private WebAppContext initWebApp () throws IOException {
77+ private WebAppContext initWebApp () {
7878 WebAppContext ctx = new WebAppContext ();
7979 ctx .setContextPath (CONFIG .getContextPath ());
80- ctx .setResourceBase (new ClassPathResource ( "webapp" ). getURI (). toString ());
80+ ctx .setResourceBase (getWebAppURIAsString ());
8181
8282 // Disable directory listings if no index.html is found.
8383 ctx .setInitParameter ("org.eclipse.jetty.servlet.Default.dirAllowed" , "false" );
@@ -139,6 +139,14 @@ private HashSet<String> getRedirectSet() {
139139 return redirectSet ;
140140 }
141141
142+ private static String getWebAppURIAsString () {
143+ try {
144+ return new ClassPathResource ("webapp" ).getURI ().toString ();
145+ } catch (IOException e ) {
146+ throw new RuntimeException (e );
147+ }
148+ }
149+
142150 // -------------------------------------------------------------------------
143151 // JSP stuff
144152 //
@@ -149,7 +157,7 @@ private HashSet<String> getRedirectSet() {
149157 // http://examples.javacodegeeks.com/enterprise-java/jetty/jetty-jsp-example
150158 // -------------------------------------------------------------------------
151159
152- private void initJSP (WebAppContext ctx ) throws IOException {
160+ private void initJSP (WebAppContext ctx ) {
153161 ctx .setAttribute ("org.eclipse.jetty.containerInitializers" , jspInitializers ());
154162 ctx .setAttribute (InstanceManager .class .getName (), new SimpleInstanceManager ());
155163 ctx .addBean (new ServletContainerInitializersStarter (ctx ), true );
0 commit comments