Spring: escaping input when binding to command

前端 未结 2 568
小蘑菇
小蘑菇 2021-02-03 13:11

How do you handle the case where you want user input from a form to be htmlEscape\'d when you are binding to a command object?

I want this to sanitize input data automa

2条回答
  •  太阳男子
    2021-02-03 13:43

    You can use @Valid and @SafeHtml from hibernate validator. See details at https://stackoverflow.com/a/40644276/548473

提交回复
热议问题