user1491927 user1491927 - 2 years ago 250
Java Question

How to set Default page in embedded jetty server

I am having embedded jetty server up & running on port 3309.

When I Query url localhost:3309 , it points to the directory structure of it.

What i am trying to do is , when I Query localhost:3309 it should point to default webpage of my application.

i.e "localhost:3309/Index.html"

How to achieve this.

I am only using jetty server with Java code without servlet , JSP.

Answer Source

The WebAppContext class has a method setWelcomeFiles(String[]); which can be used to set the welcome file.

Hope this helps!


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download