javaee / grizzly

Writing scalable server applications in the Java™ programming language has always been difficult. Before the advent of the Java New I/O API (NIO), thread management issues made it impossible for a server to scale to thousands of users. The Grizzly NIO framework has been designed to help developers to take advantage of the Java™ NIO API.
https://javaee.github.io/grizzly/
Other
222 stars 60 forks source link

Grizzly should provide setting of trailing slash to when serving static content #1823

Closed glassfishrobot closed 7 years ago

glassfishrobot commented 8 years ago

When using Grizzly to host static content like swagger-ui: httpServer = GrizzlyWebContainerFactory.create(uri); httpServer.getServerConfiguration().addHttpHandler(new StaticHttpHandler("swagger-ui"), "/swagger");

http://localhost/swagger/ works fine but http://localhost/swagger doesn't, which results in 404 not found error in the back end. It seems it tries to load from http://localhost:18888/css/typography.css but not from http://localhost:18888/swagger/css/typography.css.

Details are posted here: http://stackoverflow.com/questions/35123194/jersey-2-render-swagger-static-content-correctly-without-trailing-slash

glassfishrobot commented 8 years ago

Reported by macemers

glassfishrobot commented 8 years ago

oleksiys said: I've commited the fix. Could you pls. try 2.3.25-SNAPSHOT?

glassfishrobot commented 8 years ago

Was assigned to oleksiys

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA GRIZZLY-1823

glassfishrobot commented 7 years ago

Marked as fixed on Friday, January 6th 2017, 10:23:28 am

jcalcote commented 7 years ago

This bug seems to be back in 2.4.1 (and possibly earlier). I have my swagger static content configured under /api-docs. When I use http://localhost/api-docs, I get "Resource identified by path '/api-docs', does not exist." with grizzly error banner around it ("Grizzly 2.4.1" in bottom of banner). When I use '/api-docs/', then it renders the content as it should.

Please note, I'm using embedded grizzly server 2.4.1 with jersey. Server has a CLStaticHttpHandler configured on "/api-docs", and jersey configured at the root.