Skip to content

Commit 144ce58

Browse files
author
eugenp
committed
exception work
1 parent e85fd01 commit 144ce58

4 files changed

Lines changed: 61 additions & 17 deletions

File tree

spring-mvc-java/src/main/java/org/baeldung/spring/web/config/ClientWebConfig.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@
1313
@Configuration
1414
public class ClientWebConfig extends WebMvcConfigurerAdapter {
1515

16-
public ClientWebConfig() {
17-
super();
18-
}
16+
public ClientWebConfig() {
17+
super();
18+
}
1919

20-
// API
20+
// API
2121

22-
@Override
23-
public void addViewControllers(final ViewControllerRegistry registry) {
24-
super.addViewControllers(registry);
22+
@Override
23+
public void addViewControllers(final ViewControllerRegistry registry) {
24+
super.addViewControllers(registry);
2525

26-
registry.addViewController("/sample.html");
27-
}
26+
registry.addViewController("/sample.html");
27+
}
2828

29-
@Bean
30-
public ViewResolver viewResolver() {
31-
final InternalResourceViewResolver bean = new InternalResourceViewResolver();
29+
@Bean
30+
public ViewResolver viewResolver() {
31+
final InternalResourceViewResolver bean = new InternalResourceViewResolver();
3232

33-
bean.setViewClass(JstlView.class);
34-
bean.setPrefix("/WEB-INF/view/");
35-
bean.setSuffix(".jsp");
33+
bean.setViewClass(JstlView.class);
34+
bean.setPrefix("/WEB-INF/view/");
35+
bean.setSuffix(".jsp");
3636

37-
return bean;
38-
}
37+
return bean;
38+
}
3939
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package org.baeldung.spring.web.config;
2+
3+
import org.springframework.context.annotation.ComponentScan;
4+
import org.springframework.context.annotation.Configuration;
5+
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
6+
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
7+
8+
@Configuration
9+
@EnableWebMvc
10+
@ComponentScan("org.baeldung.web")
11+
public class WebConfig extends WebMvcConfigurerAdapter {
12+
13+
public WebConfig() {
14+
super();
15+
}
16+
17+
// API
18+
19+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.baeldung.web;
2+
3+
import org.springframework.beans.factory.annotation.Autowired;
4+
import org.springframework.stereotype.Component;
5+
6+
@Component
7+
public class BeanA {
8+
9+
@Autowired
10+
private BeanB b;
11+
12+
public BeanA() {
13+
super();
14+
}
15+
16+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package org.baeldung.web;
2+
3+
public class BeanB {
4+
5+
public BeanB() {
6+
super();
7+
}
8+
9+
}

0 commit comments

Comments
 (0)