File tree Expand file tree Collapse file tree
java/org/eclipse/jetty/server/handler
jetty-servlet/src/main/java/org/eclipse/jetty/servlet
tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -226,12 +226,17 @@ public Resource getStylesheet()
226226 {
227227 if (_defaultStylesheet == null )
228228 {
229- _defaultStylesheet = Resource . newResource ( this . getClass (). getResource ( "/jetty-dir.css" ) );
229+ _defaultStylesheet = getDefaultStylesheet ( );
230230 }
231231 return _defaultStylesheet ;
232232 }
233233 }
234234
235+ public static Resource getDefaultStylesheet ()
236+ {
237+ return Resource .newResource (ResourceHandler .class .getResource ("/jetty-dir.css" ));
238+ }
239+
235240 public String [] getWelcomeFiles ()
236241 {
237242 return _welcomes ;
File renamed without changes.
Original file line number Diff line number Diff line change 4141import org .eclipse .jetty .server .ResourceService ;
4242import org .eclipse .jetty .server .ResourceService .WelcomeFactory ;
4343import org .eclipse .jetty .server .handler .ContextHandler ;
44+ import org .eclipse .jetty .server .handler .ResourceHandler ;
4445import org .eclipse .jetty .util .URIUtil ;
4546import org .eclipse .jetty .util .log .Log ;
4647import org .eclipse .jetty .util .log .Logger ;
@@ -222,7 +223,7 @@ public void init()
222223 }
223224 if (_stylesheet == null )
224225 {
225- _stylesheet = Resource . newResource ( this . getClass (). getResource ( "/jetty-dir.css" ) );
226+ _stylesheet = ResourceHandler . getDefaultStylesheet ( );
226227 }
227228 }
228229 catch (Exception e )
Original file line number Diff line number Diff line change @@ -202,8 +202,11 @@ public void testJPMS() throws Exception
202202 assertTrue (run .awaitConsoleLogsFor ("Started @" , 10 , TimeUnit .SECONDS ));
203203
204204 startHttpClient ();
205- ContentResponse response = client .GET ("http://localhost:" + httpPort + "/test/hello" );
206- assertEquals (HttpStatus .OK_200 , response .getStatus ());
205+ ContentResponse helloResponse = client .GET ("http://localhost:" + httpPort + "/test/hello" );
206+ assertEquals (HttpStatus .OK_200 , helloResponse .getStatus ());
207+
208+ ContentResponse cssResponse = client .GET ("http://localhost:" + httpPort + "/jetty-dir.css" );
209+ assertEquals (HttpStatus .OK_200 , cssResponse .getStatus ());
207210 }
208211 }
209212
You can’t perform that action at this time.
0 commit comments