Default page for root path

北城以北 提交于 2019-12-23 12:29:12

问题


I have the following site structure:

mysite.com

  • /app1/
  • /app2/

Right now with my configuration it seems when I navigate to mysite.com, it shows a list of the apps on the server.

How can I get it to show app1/index.html when i navigate mysite.com?


回答1:


Ok... not sure why it took me this long to find the answer but... according to some page online which I now forget...

Rename app1 folder to 'root'. The default handler defined in your jettyweb config xml will then map this app to /

You can also throw in a WEB-INF folder and web.xml to define things like the default welcome page, so you don't have to type mysite.com/index.html




回答2:


That's right. You can configure one of your webapps to map to "/" by defining a context for it.

Here's the documentation:

  • jetty9 - http://www.eclipse.org/jetty/documentation/current/setting-context-path-to-root.html
  • jetty7/8 - http://wiki.eclipse.org/Jetty/Howto/SetContextPathto_/

If you simply want to disable that list of webapps mapping on the root context "/", then have a look at jetty_home/etc/webdefault.xml and the according sections in the documentation.

Hope that helps.



来源:https://stackoverflow.com/questions/13769950/default-page-for-root-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!