parent
							
								
									797db0f8e9
								
							
						
					
					
						commit
						3a6206c666
					
				| @ -11,27 +11,21 @@ import org.springframework.web.context.support.GenericWebApplicationContext; | |||||||
| import org.springframework.web.servlet.DispatcherServlet; | import org.springframework.web.servlet.DispatcherServlet; | ||||||
| 
 | 
 | ||||||
| public class StudentControllerConfig implements WebApplicationInitializer { | public class StudentControllerConfig implements WebApplicationInitializer { | ||||||
|  |    	 | ||||||
|  |    @Override | ||||||
|  |    public void onStartup(ServletContext sc) throws ServletException { | ||||||
|  | 	AnnotationConfigWebApplicationContext root = new AnnotationConfigWebApplicationContext(); | ||||||
|  | 	root.register(WebConfig.class); | ||||||
| 
 | 
 | ||||||
|  | 	root.setServletContext(sc); | ||||||
| 
 | 
 | ||||||
| 		@Override | 	// Manages the lifecycle of the root application context | ||||||
| 		public void onStartup(ServletContext sc) throws ServletException { | 	sc.addListener(new ContextLoaderListener(root)); | ||||||
| 			AnnotationConfigWebApplicationContext root = new AnnotationConfigWebApplicationContext(); |  | ||||||
| 			root.register(WebConfig.class); |  | ||||||
| 			 |  | ||||||
| 			root.refresh(); |  | ||||||
| 			root.setServletContext(sc); |  | ||||||
| 			 |  | ||||||
| 			// Manages the lifecycle of the root application context |  | ||||||
| 			sc.addListener(new ContextLoaderListener(root)); |  | ||||||
| 			 |  | ||||||
| 			 |  | ||||||
| 			 |  | ||||||
| 			DispatcherServlet dv =new DispatcherServlet(new GenericWebApplicationContext()); |  | ||||||
| 			 |  | ||||||
| 			ServletRegistration.Dynamic appServlet = sc.addServlet("test-mvc",dv );  |  | ||||||
| 			appServlet.setLoadOnStartup(1);  |  | ||||||
| 			appServlet.addMapping("/test/*"); |  | ||||||
| 		} |  | ||||||
| 
 | 
 | ||||||
|  | 	DispatcherServlet dv = new DispatcherServlet(new GenericWebApplicationContext()); | ||||||
|  | 
 | ||||||
|  | 	ServletRegistration.Dynamic appServlet = sc.addServlet("test-mvc", dv); | ||||||
|  | 	appServlet.setLoadOnStartup(1); | ||||||
|  | 	appServlet.addMapping("/test/*"); | ||||||
| 	} | 	} | ||||||
| 
 | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user