Spring MVC:如何保护应用程序免受CSRF和XSS的侵害 [英] Spring MVC : How to Protect Application from CSRF and XSS

查看:79
本文介绍了Spring MVC:如何保护应用程序免受CSRF和XSS的侵害的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

保护我们的Spring MVC应用程序免受CSRF和XSS侵扰的最佳方法是什么。

What is the best way to protect our Spring MVC application from CSRF and XSS.

对此是否有本机Spring MVC支持?

Is there native Spring MVC support for this?

推荐答案

春季:

表单(全局):

<context-param>
<param-name>defaultHtmlEscape</param-name>
<param-value>true</param-value>
</context-param>

表格(本地):

<spring:htmlEscape defaultHtmlEscape="true" />

这篇关于Spring MVC:如何保护应用程序免受CSRF和XSS的侵害的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆