`

Spring Security Web.xml 配置

阅读更多
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<!-- 	配置spring初始化参数 -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            classpath:applicationContext*.xml
        </param-value>
    </context-param>
<!--     配置spring security 过滤器 -->
    <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>
    <listener> 
    	<listener-class>
			org.springframework.security.web.session.HttpSessionEventPublisher
		</listener-class> 
	</listener>
<!--     配置spring监听器 -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
<!--     配置spring mvc 可选、struts2也可以 -->
    <servlet>
        <servlet-name>bank</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
        	<param-name>contextConfigLocation</param-name>
        	<param-value>classpath:bank-servlet.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>bank</servlet-name>
        <url-pattern>*.html</url-pattern>
     </servlet-mapping>
     <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

	<error-page>
		<error-code>403</error-code>
		<location>/error/403.jsp</location>
	</error-page>
</web-app>

 

分享到:
评论

相关推荐

    SpringSecurity 3.0.1.RELEASE.CHM

    2.2.1. 配置web.xml 2.2.2. 最小 配置 2.2.2.1. auto-config包含了什么? 2.2.2.2. 表单和基本登录选项 2.2.3. 使用其他认证提供器 2.2.3.1. 添加一个密码编码器 2.3. 高级web特性 2.3.1. Remember-Me认证 ...

    Manning.Spring.in.Action.4th.Edition.2014.11.epub

    14.1.2. Using JSR-250’s @RolesAllowed with Spring Security 14.2. Using expressions for method-level security 14.2.1. Expressing method access rules 14.2.2. Filtering method inputs and outputs 14.3. ...

    DWR.xml配置文件说明书(含源码)

    DWR.xml配置文件说明书 1、 建立dwr.xml 配置文件 任何一个dwr.xml的文件都需要包含DWR DOCTYPE的声明行,格式如下: &lt;!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN" ...

    Spring Security 中文教程.pdf

    2.2.1. 配置web.xml 2.2.2. 最小 &lt;http&gt; 配置 2.2.2.1. auto-config 包含了什么? 2.2.2.2. 表单和基本登录选项 2.2.3. 使用其他认证提供器 2.2.3.1. 添加一个密码编码器 2.3. 高级web特性 2.3.1. ...

    SpringSecurity3.1.3 Demo

    SpringSecurity3.1.3 + JDK1.7 + Maven3.3.3 + Jetty9,提供基本的pom.xml,applicationContext.xml,web.xml配置和jetty插件的配置

    Spring Security Third Edition.pdf英文版

    This book is intended for Java Web and/or RESTful webservice developers and assumes a basic understanding of creating Java 8, Java Web and/or RESTful webservice applications, XML, and the Spring ...

    Spring Boot和Spring Security应用例子

    当构建一个安全的Web应用程序时,使用Spring Boot和Spring Security可以大大简化开发过程。以下是一个示例项目,展示了如何使用这些框架来实现基本的安全功能。 构建安全的Web应用程序:一个示例项目 1. 项目准备 ...

    Spring Security例子源代码

    一个SPRING SECURITY 的简单例子从VIEW层的控制到数据库的验证

    Spring.Essentials.178398

    Understand how to secure your Spring Web and standalone applications using Spring Security declaratively and consistently Get to grips with the end-to-end development of an API-based modern SPA using ...

    Spring Security-3.0.1中文官方文档(翻译版)

    2.2.1. 配置web.xml 2.2.2. 最小&lt;http&gt; 配置 2.2.2.1. auto-config 包含了什么? 2.2.2.2. 表单和基本登录选项 2.2.3. 使用其他认证提供器 2.2.3.1. 添加一个密码编码器 2.3. 高级web 特性 2.3.1. ...

    spring-security-custom:没有 xml 配置文件的 spring 安全示例

    跟之前的 spring-security 例子相比,本例没有使用spring的配置文件,也不要在 web.xml 里配置 spring 上下文环境。而是通过两个类来启动。 Spring Security Maven依赖项,pom.xml: &lt;!-- ... other dependency ...

    Getting.started.with.Spring.Framework.2nd.Edition1491011912.epub

    Chapter 12 –Developing RESTful web services using Spring Web MVC Chapter 13 – More Spring Web MVC – internationalization, file upload and asynchronous request processing Chapter 14 – Securing ...

    spring security 参考手册中文版

    6.2.1 web.xml配置 50 6.2.2最小的配置 50 6.2.3表单和基本登录选项 52 设置默认的登录目的地 54 6.2.4注销处理 54 6.2.5使用其他身份验证提供程序 55 添加密码编码器 56 6.3高级Web功能 56 6.3.1记得我认证 56 ...

    安全框架Spring Security深入浅出视频教程

    视频详细讲解,需要的小伙伴自行网盘下载,链接见附件,永久有效。 首先,SSM环境中我们通过xml配置的...Springsecurity在两种不同的开发模式中使用,有经典的独立web后台管理系统,也有时下最流行的前后端分离场景。

    Spring Security3 张卫滨(译)

    添加Spring Security XML配置文件的应用到web.xml ................................................ 20 注意这些不足之处 ......................................................................................

    Learning.Spring.Application.Development.1783987367

    Title: Learning Spring Application Development Author: Ravi Kant Soni Length: 492 pages ...Chapter 6: Spring Security Chapter 7: Spring Testing Chapter 8: Integrating Javamail And Jms With Spring

    Pro.Spring.Boot.1942270003

    Chapter 8: Web Development with Spring Boot Chapter 9: Security with Spring Boot Chapter 10: Messaging with Spring Boot Chapter 11: Spring Boot Actuator Chapter 12: Deploying Spring Boot Chapter 13: ...

    spring-boot-reference.pdf

    27.1. The “Spring Web MVC Framework” 27.1.1. Spring MVC Auto-configuration 27.1.2. HttpMessageConverters 27.1.3. Custom JSON Serializers and Deserializers 27.1.4. MessageCodesResolver 27.1.5. Static...

    4、Spring Security 安全权限管理手册

    配置Web.xml,应用安全过滤器 配置Spring,验证与授权部分 在web页面中获取用户身份 在web页面中应用安全标签库 实现方法级安全 6、配置web.xml 7、Spring配置文件中设置命名空间 8、通过数据库验证用户身份 9、完善...

Global site tag (gtag.js) - Google Analytics