目前我有一个Web应用程序,我们使用web.xml来配置应用程序.web.xml有welcome-file-list.
<web-app>
...
<welcome-file-list>
<welcome-file>home.html</welcome-file>
</welcome-file-list>
</web-app>
Run Code Online (Sandbox Code Playgroud)
我们计划使用spring框架并使用java类进行应用程序配置.
class MyApplication extends WebApplicationInitializer {
public void onStartUp(ServletContext context){
...
}
}
Run Code Online (Sandbox Code Playgroud)
如何在此java类中指定welcome-file-list?
我试图在Spring MVC 4中从XML迁移到完全基于 java 类的配置.到目前为止我所做的是创建一个简单的WebAppInitializer类和一个WebConfig类.
但是,我找不到配置我的欢迎页面的方法,这是我以前的摘录Web.xml:
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
Run Code Online (Sandbox Code Playgroud)
任何帮助,将不胜感激.