28 Mayıs 2017 Pazar

SpringMVC WebApplicationContext Sınıfı

Giriş
ApplicationContext arayüzünü gerçekleştirir. Açıklaması şöyle
Interface to provide configuration for a web application.
Şeklen şöyle
Açıklaması şöyle
Sometimes circumstances do not allow you to completely switch to a different framework. The Spring Framework does not force you to use everything within it; it is not an all-or-nothing solution. Existing front-ends built with Struts, Tapestry, JSF or other UI frameworks can be integrated with a Spring- based middle-tier, which allows you to use Spring transaction features. You simply need to wire up your business logic using an ApplicationContext and use a WebApplicationContext to integrate your web layer.
Spring ile 3 çeşit WebApplication yapılabilir. Açıklaması şöyle
For REACTIVE , it will create AnnotationConfigReactiveWebServerApplicationContext
For SERVLET , it will create AnnotationConfigServletWebServerApplicationContext
For NONE, it will create AnnotationConfigApplicationContext

constructor
Spring tarafından yaratılmayan HttpServlet sınıfında erişmek için şöyle yaparız.
WebApplicationContext appContext = WebApplicationContextUtils
  .getWebApplicationContext(getServletContext());

Hiç yorum yok:

Yorum Gönder