I'm working on Spring MVC annotation based application. I have web.xml file entry as follows (using WebConfig.java for configuration):
<servlet>
<servlet-name>sdsdispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextClass</param-name>
<param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
</init-param>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>com.conf.WebConfig</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
Now when I try to integrate security related XML file I'm facing following error
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:638)
I tried to import xml file as follows:
@Configuration
@EnableWebMvc
@ComponentScan("com.stk.controller")
@ImportResource({"securityContext.xml"})
public class WebConfig extends WebMvcConfigurerAdapter {
Screenshot