简体   繁体   English

序列化JTable的TableModel

[英]Serialize JTable's TableModel

I need to send the content of a JTable to a REST Service. 我需要将JTable的内容发送到REST服务。 For this purpose, I'd like to send the TableModel to the REST Service. 为此,我想将TableModel发送到REST服务。 However, I can see that the TableModel class is not Serializable . 但是,我可以看到TableModel类不是Serializable

Is there any other option other than copying the TableModel in a wrapper Java class ( Serializable )? 除了在包装Java类( Serializable )中复制TableModel ,还有其他选择吗?

Usually table's row is dto. 通常表的行是dto。 So you need send just collection of dtos using available marshallers (json, xml etc). 因此,您只需要使用可用的编组器(json,xml等)发送dto的集合即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM