Spring JavaConfig Reference Guide - Spring Web Services - Parent ...

Spring JavaConfig Reference Guide - Spring Web Services - Parent ... Spring JavaConfig Reference Guide - Spring Web Services - Parent ...

static.springsource.org
from static.springsource.org More from this publisher
13.07.2015 Views

Using aspects}}...JavaConfigApplicationContext context = new JavaConfigApplicationContext(MyConfig.class);or...@Aspect // necessary in order to have transferService@Configurationpublic class MyConfig {@Beanpublic TransferService myService() {return new TransferServiceImpl(...);}}bean get aspects applied!...JavaConfigApplicationContext context =new JavaConfigApplicationContext(MyConfig.class, PropertyChangeTracker.class);NoteAnnotating Configuration classes with @Aspect to enable AOP functionality is not consistent withthe standard semantics around the @Aspect annotation, and would thus likely be un-intuitive tosomeone familiar with XML configuration. This approach to applying aspects will change prior toJavaConfig's 1.0 GA release. See SJC-55 for details.Spring JavaConfig 23

Chapter 7. Developing web applications withJavaConfigJavaConfig provides the JavaConfigWebApplicationContext class for bootstrapping your configurations intothe web tier.7.1. JavaConfigWebApplicationContextJavaConfigWebApplicationContext allows for seamlessly bootstrapping JavaConfig bean definitions withinyour servlet container's web.xml. This process requires no Spring XML bean definitions whatsoever:org.springframework.web.context.ContextLoaderListenercontextClassorg.springframework.config.java.context.JavaConfigWebApplicationContextcontextConfigLocationexample.RootApplicationConfigtestorg.springframework.web.servlet.DispatcherServletcontextClassorg.springframework.config.java.context.JavaConfigWebApplicationContextcontextConfigLocationexample.web.WebBeansConfigFor basic information regarding initialization parameters to DispatcherServlet and use ofContextLoaderListener, see Chapter 13. Web MVC framework in the Core Spring Frameworkdocumentation.Spring JavaConfig 24

Using aspects}}...<strong>JavaConfig</strong>ApplicationContext context = new <strong>JavaConfig</strong>ApplicationContext(MyConfig.class);or...@Aspect // necessary in order to have transferService@Configurationpublic class MyConfig {@Beanpublic TransferService myService() {return new TransferServiceImpl(...);}}bean get aspects applied!...<strong>JavaConfig</strong>ApplicationContext context =new <strong>JavaConfig</strong>ApplicationContext(MyConfig.class, PropertyChangeTracker.class);NoteAnnotating Configuration classes with @Aspect to enable AOP functionality is not consistent withthe standard semantics around the @Aspect annotation, and would thus likely be un-intuitive tosomeone familiar with XML configuration. This approach to applying aspects will change prior to<strong>JavaConfig</strong>'s 1.0 GA release. See SJC-55 for details.<strong>Spring</strong> <strong>JavaConfig</strong> 23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!