Avoiding "," (comma) in Spring Converting Strings to Array or List

We have a Spring binding that converts strings to Lists using the default converters available with Spring.

For example, if we have a, b, cclicked from a form, then the controller receives Listwith the elements:

  • and
  • b
  • with

We do not need to do anything in our code.

I have a problem with commas in my data. If I post a, x,z, b , chere x,zis really a String, but Converter Spring does not know this and suggests that it is a separator and is Listas follows:

  • and
  • x
  • at
  • b
  • with

Now I come to my questions:

  • Can I escape ,(comma) in my data when submitting a form?
  • , ?
  • ?
  • , ?
  • , , , , ?
+4
1

?

"a", "x, z", "b", "c"

0

Source: https://habr.com/ru/post/1540818/


All Articles