// Create the servlet instance and set up the parameters from data
// model
servlet = WebapplicationFactory.eINSTANCE.createServlet();
servlet.setServletName(CLICK_SERVLET_NAME);
ServletType servletType = WebapplicationFactory.eINSTANCE.createServletType();
if(useSpring){
servletType.setClassName(CLICK_SPRING_SERVLET_CLASS);
// if (webApp.getJ2EEVersionID() >= J2EEVersionConstants.J2EE_1_4_ID) {
// // J2EE 1.4
// ParamValue initParam = CommonFactory.eINSTANCE.createParamValue();
// initParam.setName("spring-path");
// initParam.setValue("/applicationContext.xml");
// servlet.getInitParams().add(initParam);
// } else {
// // J2EE 1.2 or 1.3
// InitParam initParam = WebapplicationFactory.eINSTANCE.createInitParam();
// initParam.setParamName("spring-path");
// initParam.setParamValue("/applicationContext.xml");
// servlet.getParams().add(initParam);
// }
} else {
servletType.setClassName(CLICK_SERVLET_CLASS);
}
servlet.setWebType(servletType);
servlet.setLoadOnStartup(new Integer(1));
// Add the servlet to the web application model