@Override
public void init() throws ServletException {
super.init();
WebAppConfiguration config;
WebAppWelcomeFileList welcomeFileList;
String contextdir = this.getServletContext().getRealPath("/");
try {
config = WebAppConfigurationFactory.getConfiguration(new File(contextdir));
welcomeFileList = config.getWelcomeFileList();
} catch (WebAppConfigurationException e) {
// Errors on getting configuration from web.xml
welcomeFileList = null;
}
if (welcomeFileList != null) {
welcomeFiles = welcomeFileList.getWelcomeFiles();
for (int i = 0; i < welcomeFiles.length; ++i) {
welcomeFiles[i] = welcomeFiles[i].trim();
}
}
}