Deep Cloning an object on the client side (GWT + Javascript) ?

后端 未结 2 1014
春和景丽
春和景丽 2021-01-21 16:30

I know of a Deep Cloning library in Java, which I use in my server side code.

However, right now I need to \"deep clone\" an object on the client side code. I believe t

2条回答
  •  抹茶落季
    2021-01-21 17:09

    You could use JSNI to use YUI3 code from GWT Code, however you would have to include the whole YUI3 source in your GWT app which might be a litle bit inefficient if you only need the deep cloning functionality.
    If you have the the source code for the deep cloning library for your java backend you might use it also on the GWT client if there are no external dependencies.
    You can check out also these resources for more info:

    How can I deep copy an arbitrary object in GWT?
    GWT Overlay deep copy

提交回复
热议问题