springSecurity如何在配置文件中配置需要放行的

1.虽然注册页面我配置了放行,但是注册页面上的请求全部被springsecurity安全框架拦截了,请问如何在配置文件中配置放行指定的get/post请求吗?以下是配置文件

<!--放行不需要拦截的资源页面-->
    <security:http pattern="/login.jsp" security="none"></security:http>
    <security:http pattern="/failer.jsp" security="none"></security:http>
    <security:http pattern="/403.jsp" security="none"></security:http>
    <security:http pattern="/register.jsp" security="none"></security:http>
    <security:http pattern="/sampling.jsp" security="none"></security:http>
    <!--<security:http pattern="/index.jsp" security="none"></security:http>-->
    <security:http pattern="/css/**" security="none"></security:http>
    <security:http pattern="/img/**" security="none"></security:http>
    <security:http pattern="/pages/**" security="none"></security:http>
    <security:http pattern="/plugins/**" security="none"></security:http>
    <!--配置拦截的规则和放行的条件
    auto-config 支持默认的配置
    use-expression 使用表达式 为false 关闭表达式
    intercept-url  拦截的资源规则
    access  允许访问的角色条件
    -->
    <security:http auto-config="true" use-expressions="false">
        <!--多个角色之间是或者的关系 任意角色即可登录-->
        <security:intercept-url pattern="/**" access="ROLE_USER,ROLE_TEST"></security:intercept-url>
        <!--
        login-page  自定义登录页面
        login-processing-url 登录页面form表单请求的url地址
        default-target-url  登录成功目标页面
        authentication-failure-url 登录失败的页面
        -->
        <security:form-login login-page="/login.jsp"
                             login-processing-url="/login"
                             default-target-url="/index.jsp"
                             authentication-failure-url="/failer.jsp"></security:form-login>
        <!--配置登录成功权限不足的处理-->
        <security:access-denied-handler error-page="/403.jsp"></security:access-denied-handler>
        <!--关闭跨域请求的拦截-->
        <security:csrf disabled="true"></security:csrf>
        <!--配置退出的过滤器
        invalidate-session="true" session过期
        logout-success-url  退出成功的跳转页
        logout-url  页面发起退出请求的路径
        -->
        <security:logout invalidate-session="true"
                         logout-success-url="/login.jsp"
                         logout-url="/logout"></security:logout>

    </security:http>

    <!--配置拦截访问的验证-->
    <security:authentication-manager>
        <security:authentication-provider user-service-ref="userService">
            <!--验证过的业务实现类使用框架的UserDetailService-->
            <!--初始化固定的账号用于测试
            {noop}表示密码验证方式为明文验证 原始密码 123456
                                    密文验证 加密密码 fd34falfacdffa34rfafadfa
            <security:user name="user" password="{noop}user" authorities="ROLE_USER"></security:user>
            <security:user name="admin" password="{noop}admin" authorities="ROLE_ADMIN"></security:user>
            -->
            <!--选择系统默认的加密方式-->
            <security:password-encoder hash="bcrypt"></security:password-encoder>
        </security:authentication-provider>
    </security:authentication-manager>

    <!--配置加密工具类的bean对象-->
    <bean id="pwdEncoder" class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder"></bean>
</beans>
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!