使用index.html作为欢迎页面 [英] Use index.html as welcome page
本文介绍了使用index.html作为欢迎页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个简单的java应用程序。我想将index.html设置为我的欢迎页面。
I have a simple java application. I want to set index.html as my welcome page.
我试了但是它没有用。虽然index.jsp正在运行。
是否可以使用index.html?
I tried it but its not working. Although index.jsp is working. Is it possible to use index.html?
<display-name>sample</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>sample</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>sample</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
推荐答案
也许是因为您正在进行的servlet映射。
Maybe it is because of the servlet mapping you are doing.
你应该将< url-pattern> * .html< / url-pattern>
改为不同的东西这样就没有扩散了。
You should change <url-pattern>*.html</url-pattern>
to something different so that there is no diffusion.
这篇关于使用index.html作为欢迎页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文