In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Today, I will talk to you about the implementation of the fromObject method in Hiberna when the foreground page can not get the json object, many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
Map map=new HashMap (); if (orderless null) {order.setGoodList (null); order.setOdate (null);} if (goodListworthy null) {for (Goods g:goodList) {g.setOrderList (null) }} map.put ("order", order); map.put ("goodList", goodList); System.out.println (order.getOid ()); System.out.println (order.toString ()); JSONObject json = JSONObject.fromObject (map); response.setCharacterEncoding ("utf-8") Response.getWriter () .write (json.toString ()
The above is a way to solve the endless loop, of course, jackson is the best way to deal with it!
The appearance of an endless loop is that it cannot execute to the next line of fromObject
The solution is:
It could be an endless loop or a missing jar package (json requires six jar packages). If it is an endless loop, the object that causes the loop (usually of type List or Set) is set to null.
The fromObject method also has a weak handling of date-type data, either registering a date processor or setting the date to null.
MyEclipse's generated toString methods for entity classes can lead to an endless loop for reasons similar to the fromObject method.
After reading the above, do you have any further understanding of what to do if the foreground page cannot get the json object when the fromObject method is executed in Hiberna? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.