users@grizzly.java.net

Re: Regarding welcome file - index.html

From: Ryan Lubke <ryan.lubke_at_oracle.com>
Date: Fri, 05 May 2017 08:53:46 -0700

Sorry for the delay.

The logic within StaticHttpHandler should look for index.html if the
request matches a directory [1]

If you have a test case, you can open an issue [2] and attach it and we
can investigate.


[1]
https://github.com/javaee/grizzly/blob/2.3.x/modules/http-server/src/main/java/org/glassfish/grizzly/http/server/StaticHttpHandler.java#L221
[2] https://github.com/javaee/grizzly/issues

> Ajeeth Kannan (RIT Student) <mailto:ak5378_at_rit.edu>
> May 3, 2017 at 14:08
> Hello,
>
> I would like to specify a static index.html page as my welcome page in
> the server when I get a request from the client for my application.
> How should I specify ?
>
> I have written the following code but it does not work
>
> *StaticHttpHandler staticHttpHandler =
> new StaticHttpHandler("/src/main/web/");*
>
> *server.getServerConfiguration().addHttpHandler(staticHttpHandler, "/");*
>
>
> Thank you,
> Ajeeth Kannan