exception work
This commit is contained in:
parent
e85fd01d61
commit
144ce58d76
|
@ -13,27 +13,27 @@ import org.springframework.web.servlet.view.JstlView;
|
||||||
@Configuration
|
@Configuration
|
||||||
public class ClientWebConfig extends WebMvcConfigurerAdapter {
|
public class ClientWebConfig extends WebMvcConfigurerAdapter {
|
||||||
|
|
||||||
public ClientWebConfig() {
|
public ClientWebConfig() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
// API
|
// API
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addViewControllers(final ViewControllerRegistry registry) {
|
public void addViewControllers(final ViewControllerRegistry registry) {
|
||||||
super.addViewControllers(registry);
|
super.addViewControllers(registry);
|
||||||
|
|
||||||
registry.addViewController("/sample.html");
|
registry.addViewController("/sample.html");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public ViewResolver viewResolver() {
|
public ViewResolver viewResolver() {
|
||||||
final InternalResourceViewResolver bean = new InternalResourceViewResolver();
|
final InternalResourceViewResolver bean = new InternalResourceViewResolver();
|
||||||
|
|
||||||
bean.setViewClass(JstlView.class);
|
bean.setViewClass(JstlView.class);
|
||||||
bean.setPrefix("/WEB-INF/view/");
|
bean.setPrefix("/WEB-INF/view/");
|
||||||
bean.setSuffix(".jsp");
|
bean.setSuffix(".jsp");
|
||||||
|
|
||||||
return bean;
|
return bean;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package org.baeldung.spring.web.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableWebMvc
|
||||||
|
@ComponentScan("org.baeldung.web")
|
||||||
|
public class WebConfig extends WebMvcConfigurerAdapter {
|
||||||
|
|
||||||
|
public WebConfig() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
// API
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package org.baeldung.web;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class BeanA {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BeanB b;
|
||||||
|
|
||||||
|
public BeanA() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package org.baeldung.web;
|
||||||
|
|
||||||
|
public class BeanB {
|
||||||
|
|
||||||
|
public BeanB() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue