1

I have a pre defined json that has the following variable assigned to a JSON Object:

{
    ....
    "class": "P"
    ....
}

Trouble is, I'm using the Struts 2 JSON plugin and the following code:

private String class

is not allowed, since class is a reserved keyword. Does anyone know of a way to override the variable names in Struts 2's JSON plugin?

Roman C
  • 49,761
  • 33
  • 66
  • 176
jtyler
  • 1,055
  • 2
  • 15
  • 22

1 Answers1

1

You can use getClass() instead, also there's @JSON annotation where you can specify name.

Roman C
  • 49,761
  • 33
  • 66
  • 176