这是一个寻求帮助的帖子,不是解决问题的帖子(问题以解决!!!!!!!!!!)
在SSM中使用了SpringSecurity之后,启动tomcat弹出的页面就会出现报错,开发环境和报错信息如下:
开发的环境 : IDEA
错误提示:java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener or DispatcherServlet registered
页面报错信息:
导入的依赖
<!-- SpringSecurity 对 Web 应用进行权限管理 -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${security-version}</version>
</dependency>
<!-- SpringSecurity 配置 -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${security-version}</version>
</dependency>
<!-- SpringSecurity 标签库 -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>${security-version}</version>
</dependency>
配置SpringSecurity的web.xml
<!--配置springsecurity的DelegatingFilterProxy-->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
创建的注册类
package com.atguigu.crowd.mvc.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@Configuration
@EnableWebSecurity
public class WebAppSecurityConfig extends WebSecurityConfigurerAdapter {
}
在没有对配置类进行具体配置之前就出现了问题。我自己经过测试,在只对web.xml进行配置之后启动tomcat就出现了如上的问题,请求大家帮帮我,在百度搜来的都是千篇一律的。根本没有实际的作用。谢谢大家!!!