ApplicationContext and ServletContext

前端 未结 5 585
孤独总比滥情好
孤独总比滥情好 2020-12-23 09:55

I get confused between the two ApplicationContext and ServletContext when it comes to Spring MVC Application. I know that There is just only One ApplicationContext per Sprin

5条回答
  •  清酒与你
    2020-12-23 10:13

    In Spring, to read a specific initialisation configuration file, we use the context-param with the predefined name called contextConfigLocation.

    
      WebFlow context configuration
      contextConfigLocation
      /WEB-INF/test-context.xml
     
    

    But in case of Plain J2EE web application without including any frameworks, the context-param can read from any where in the application i.e. any servlet, filter.

    The difference between ApplicationContext and ServletContext, sanjay explained

提交回复
热议问题