V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
iszengmh
V2EX  ›  程序员

spring security5.0 如何才能让/**与/index.html 不冲突

  •  
  •   iszengmh · Nov 14, 2019 via Android · 1328 views
    This topic created in 2359 days ago, the information mentioned may be changed or developed.

    spring security5.0 如何才能让 /与 /index.html 不冲突,让所有路径需要权限,但是只开放 index.html,明明在 XML 中配置了<security:http pattern="/index.html" security="none"/>'但是在<security:http use-expression="false" entry-point-ref="ajaxAuthenticationPoint" auto-config="false"><security:intercept-url pattern="/" access="ROLE_USER"/>security:http/配置所有路径权限,导致 index 也无法访问了

    1 replies    2019-11-14 11:12:55 +08:00
    hantsy
        1
    hantsy  
       Nov 14, 2019
    好多年没见过 XML 配置了。

    按以下顺序设置试一下:

    1. pattern="/**" access="ROLE_USER"
    2. pattern="/index.html access 设置成匿名
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5374 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 07:25 · PVG 15:25 · LAX 00:25 · JFK 03:25
    ♥ Do have faith in what you're doing.