Open arinban opened 6 years ago
@rlubke Commented @jcalcote The fix implemented in #1823 hasn't changed. I've performed a simple test here and it appears to be working as expected.
Can you provide a small maven-based test case showing the issue?
@jcalcote Commented Sorry it took so long to get back to you @rlubke. I think I know what's causing the problem. First, here's my sample application - it's just a maven project using the jersey-quickstart-grizzly2 archetype (for jersey 2.26).
The ONLY change I made was to replaced the last line in main
as follows:
HttpServer server = GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);
ClassLoader loader = Main.class.getClassLoader();
CLStaticHttpHandler docsHandler = new CLStaticHttpHandler(loader, "html/");
docsHandler.setFileCacheEnabled(false);
server.getServerConfiguration().addHttpHandler(docsHandler, "/docs");
return server;
Then I added a resource: /resources/html/index.html:
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"></head>
<body>Hi there!</body>
</html>
Hitting http://localhost:8080/myapp/myresource returns "Got it!"
Hitting http://localhost:8080/docs returns a grizzly error banner - black and yellow - "Not Found" in the title, "Resource identified by path '/docs', does not exist.", footer contains Grizzly 2.4.0.
Hitting http://localhost;8080/docs/ returns "Hi there!" - the content of the index.html page.
--John
@rlubke Commented Though the end result is the same, this is a different issue. The issue appears to be within the Mapper which is a picky code path. This will require a bit of time.
@jcalcote Commented Thanks for looking into it - I have a work around for the moment - I really wanted my swagger docs to be at the root resource, so I just added a root resource in jersey that redirects to /docs/ - as long as people hit the root instead of the /docs path, they'll land in the right place.
Please see my comment on https://github.com/javaee/grizzly/issues/1823 (closed). Wanted to make sure this issue got seen, so I opened a new one. Sorry if that's not the proper procedure.