V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
kenduffy
V2EX  ›  问与答

SpringMVC: 可以在表格外将数据存入 model 吗?

  •  
  •   kenduffy · Nov 29, 2017 · 1797 views
    This topic created in 3071 days ago, the information mentioned may be changed or developed.

    针对 CSRF,我需要生成一个 token,然后在每次客户 http 请求的时候带上

    因为项目有很多页面

    现在的做法是要在每个页面的表格内上加一个

    <input type="hidden" name="CSRFToken" value="${csrf}" />
    

    这样很麻烦

    现在的项目里,每一个页面都会引用一个头部 jsp 文件

    有没有什么方法可以在这个头部 jsp 文件上加上 token

    让所有引用了这个头部 jsp 的页面提交的时候能提交这个 token ?

    1 replies    2017-11-29 11:02:40 +08:00
    kenduffy
        1
    kenduffy  
    OP
       Nov 29, 2017
    顶顶顶顶顶
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5074 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 09:46 · PVG 17:46 · LAX 02:46 · JFK 05:46
    ♥ Do have faith in what you're doing.