Quantcast

Regarding welcome file - index.html

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Regarding welcome file - index.html

Ajeeth Kannan (RIT Student)
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 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Regarding welcome file - index.html

Ryan Lubke-2
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

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 

Loading...