File tree 4 files changed +13
-4
lines changed
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
4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -226,12 +226,17 @@ public Resource getStylesheet()
226
226
{
227
227
if (_defaultStylesheet == null )
228
228
{
229
- _defaultStylesheet = Resource . newResource ( this . getClass (). getResource ( "/jetty-dir.css" ) );
229
+ _defaultStylesheet = getDefaultStylesheet ( );
230
230
}
231
231
return _defaultStylesheet ;
232
232
}
233
233
}
234
234
235
+ public static Resource getDefaultStylesheet ()
236
+ {
237
+ return Resource .newResource (ResourceHandler .class .getResource ("/jetty-dir.css" ));
238
+ }
239
+
235
240
public String [] getWelcomeFiles ()
236
241
{
237
242
return _welcomes ;
File renamed without changes.
Original file line number Diff line number Diff line change 41
41
import org .eclipse .jetty .server .ResourceService ;
42
42
import org .eclipse .jetty .server .ResourceService .WelcomeFactory ;
43
43
import org .eclipse .jetty .server .handler .ContextHandler ;
44
+ import org .eclipse .jetty .server .handler .ResourceHandler ;
44
45
import org .eclipse .jetty .util .URIUtil ;
45
46
import org .eclipse .jetty .util .log .Log ;
46
47
import org .eclipse .jetty .util .log .Logger ;
@@ -222,7 +223,7 @@ public void init()
222
223
}
223
224
if (_stylesheet == null )
224
225
{
225
- _stylesheet = Resource . newResource ( this . getClass (). getResource ( "/jetty-dir.css" ) );
226
+ _stylesheet = ResourceHandler . getDefaultStylesheet ( );
226
227
}
227
228
}
228
229
catch (Exception e )
Original file line number Diff line number Diff line change @@ -202,8 +202,11 @@ public void testJPMS() throws Exception
202
202
assertTrue (run .awaitConsoleLogsFor ("Started @" , 10 , TimeUnit .SECONDS ));
203
203
204
204
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 ());
207
210
}
208
211
}
209
212
You can’t perform that action at this time.
0 commit comments