简体   繁体   English

如何在嵌入式Jetty服务器中设置默认页面

[英]How to set Default page in embedded jetty server

I am having embedded jetty server up & running on port 3309. 我将嵌入式码头服务器启动并在端口3309上运行。

When I Query url localhost:3309 , it points to the directory structure of it. 当我查询url localhost:3309时,它指向它的目录结构。

What i am trying to do is , when I Query localhost:3309 it should point to default webpage of my application. 我想做的是,当我查询localhost:3309时,它应指向应用程序的默认网页。

ie "localhost:3309/Index.html" 即“ localhost:3309 / Index.html”

How to achieve this. 如何实现这一目标。

I am only using jetty server with Java code without servlet , JSP. 我只使用带有Java代码的Jetty服务器,而没有servlet,JSP。

The WebAppContext class has a method setWelcomeFiles(String[]); WebAppContext类具有方法setWelcomeFiles(String[]); which can be used to set the welcome file. 可以用来设置欢迎文件。

Hope this helps! 希望这可以帮助!

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM