The springboot project uses @ RestController annotations. Is there a potential problem if the VO class does not implement the Serializable interface?

and input parameters use @ RequestBody annotations


Serializable is a serialization method specific to the java language and cannot be cross-language.
RestController is a serialization scheme for cross-language schemes such as json,xml or protobuf, which is naturally not related to Serializable


first clarify the role of serialization:

  • when you want to save the object state in memory to a file or database
  • when you want to spread objects over the network
For a more in-depth understanding of

, please refer to the article http://blademastercoder.githu.

.

secondly, according to the above function, your vo needs neither persistence nor network transmission, so there will be no problem, just front-end data parsing and conversion to back-end vo


I guess your concern is whether these annotations have anything to do with Serializable ,

.

my understanding is:

@ RestController ( @ ResponseBody + @ Controller ), @ RequestBody are not directly related to Serializable , and the potential problems of not implementing the interface have nothing to do with these annotations.

refer to similar questions java-web-Javabean? What's the point? -SegmentFault think

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eddfe4-49769.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eddfe4-49769.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?