Skip to content

Commit 6f2c2a7

Browse files
christian-raedelslavisa-baeldung
authored andcommitted
BAEL-86:
- Changed component scanning.
1 parent da0f93f commit 6f2c2a7

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎spring-dispatcher-servlet/src/main/java/com/baeldung/spring/dispatcher/servlet/WebApplicationInitializer.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ public void onStartup(ServletContext servletContext) throws ServletException {
1919
AnnotationConfigWebApplicationContext webContext =
2020
new AnnotationConfigWebApplicationContext();
2121
webContext.register(WebConfiguration.class);
22-
webContext.scan("com.baeldung.spring.dispatcher.servlet.web");
22+
DispatcherServlet dispatcherServlet = new DispatcherServlet(webContext);
2323
ServletRegistration.Dynamic servlet = servletContext.addServlet("dispatcher",
24-
new DispatcherServlet(webContext));
24+
dispatcherServlet);
2525
servlet.addMapping("/*");
2626
MultipartConfigElement multipartConfigElement =
2727
new MultipartConfigElement("/tmp");

‎spring-dispatcher-servlet/src/main/java/com/baeldung/spring/dispatcher/servlet/WebConfiguration.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import java.util.Locale;
2828

2929
@Configuration
30-
@ComponentScan("com.baeldung.enterprise.patterns.dispatcher.servlet.web")
30+
@ComponentScan("com.baeldung.spring.dispatcher.servlet.web")
3131
@EnableWebMvc
3232
public class WebConfiguration extends WebMvcConfigurerAdapter {
3333
@Override

0 commit comments

Comments
 (0)