You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class A {
String name;
B b;
}
public class B {
String name;
A a;
}
A a = new A();
B b = new B();
a.name = "testa";
b.name = "testb";
a.b = b;
b.a = a;
Json.toJson(a)
今天 @jay 蓝色幽默 突然给我说, 现在JSON不支持循环引用的序列化与反序列化, 但是这种情况很多时候都要用到. 有点问题.
当时讨论了一下, 感觉可以弄个对象引用符的形式, 然后跟EL进行整合, 通过EL来读取引用信息. 例子:
生成:
其中root是一个root.abc.bcd形式的路径. 同时通过这样的整合, 可以使JSON完全支持EL表达式.
The text was updated successfully, but these errors were encountered: