|
@@ -12,31 +12,28 @@ import javax.servlet.ServletContext;
|
|
|
import javax.servlet.ServletException;
|
|
|
import javax.servlet.ServletRegistration;
|
|
|
|
|
|
-public class Application implements WebApplicationInitializer {
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onStartup(ServletContext servletContext) throws ServletException {
|
|
|
-
|
|
|
- XmlWebApplicationContext applicationContext = new XmlWebApplicationContext();
|
|
|
- applicationContext.setConfigLocation("classpath:spring.xml");
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-// AnnotationConfigWebApplicationContext applicationContext =
|
|
|
-// new AnnotationConfigWebApplicationContext();
|
|
|
-// applicationContext.register( SpringConfig.class );
|
|
|
-
|
|
|
- //配置 MVC 配置档
|
|
|
- //配置 Mybatis配置档
|
|
|
-
|
|
|
- DispatcherServlet dispatcherServlet = new DispatcherServlet(applicationContext);
|
|
|
-
|
|
|
- ServletRegistration.Dynamic dispatcher =
|
|
|
- servletContext.addServlet("dispatcher", dispatcherServlet);
|
|
|
-
|
|
|
- dispatcher.setLoadOnStartup(1);
|
|
|
- dispatcher.addMapping("/");
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
+//public class Application implements WebApplicationInitializer {
|
|
|
+//
|
|
|
+// @Override
|
|
|
+// public void onStartup(ServletContext servletContext) throws ServletException {
|
|
|
+//
|
|
|
+// XmlWebApplicationContext applicationContext = new XmlWebApplicationContext();
|
|
|
+// applicationContext.setConfigLocation("classpath:spring.xml");
|
|
|
+//
|
|
|
+//// AnnotationConfigWebApplicationContext applicationContext =
|
|
|
+//// new AnnotationConfigWebApplicationContext();
|
|
|
+//// applicationContext.register( SpringConfig.class );
|
|
|
+//
|
|
|
+// //配置 MVC 配置档
|
|
|
+// //配置 Mybatis配置档
|
|
|
+// DispatcherServlet dispatcherServlet = new DispatcherServlet(applicationContext);
|
|
|
+//
|
|
|
+// ServletRegistration.Dynamic dispatcher =
|
|
|
+// servletContext.addServlet("dispatcher", dispatcherServlet);
|
|
|
+//
|
|
|
+// dispatcher.setLoadOnStartup(1);
|
|
|
+// dispatcher.addMapping("/");
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+//}
|