• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What is container in Spring MVC and when does it exactly get created when you run the application?

 
Ranch Hand
Posts: 240
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As i studied, there are two spring containers BeanFactory and ApplicationContext. But what if I develop a spring web application where i do not use any of the two because i did not dependency injection.
So my question is who plays the role of container in that case and when does it exactly get created in the program?

thanks in advance.
 
Bartender
Posts: 1152
20
Mac OS X IntelliJ IDE Oracle Spring VI Editor Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

In short, the BeanFactory provides the configuration framework and basic functionality, and the ApplicationContext adds more enterprise-specific functionality. The ApplicationContext is a complete superset of the BeanFactory, and is used exclusively in this chapter in descriptions of Spring’s IoC container.  

Spring Docs
 
Arun Singh Raaj
Ranch Hand
Posts: 240
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

In short, the BeanFactory provides the configuration framework and basic functionality, and the ApplicationContext adds more enterprise-specific functionality. The ApplicationContext is a complete superset of the BeanFactory, and is used exclusively in this chapter in descriptions of Spring’s IoC container.



Ok sir, but i want to know about Spring MVC program where i did not even need Dependency Injection or ApplicationContext, BeanFactory. Then who is the container?
 
Peter Rooke
Bartender
Posts: 1152
20
Mac OS X IntelliJ IDE Oracle Spring VI Editor Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't know what your asking.  

Spring is based around IoC and DI, and Spring-MVC is an extension of that.  If you don't want a container then simply don't use Spring.  
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Container" usually means the web application server.

When you create a webapp using Spring MVC, that application would take the form of a WAR, per the J2EE/JEE standards. The WAR is then deployed to the container, so it isn't a case of when does the container get created when you run the application, since the container gets created first.

Traditionally, you'd launch the webapp container externally, then deploy your WAR into it. With Spring Boot, there's a container bundled with the WAR, so Spring Boot actually launches its own private container then deploys the associated WAR to that container, packing all 3 components - launcher, container, and webapp - into one single archive file.
 
Arun Singh Raaj
Ranch Hand
Posts: 240
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic