In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces the example analysis of the output stream at the end of servlet in Ajax technology, which is very detailed and has a certain reference value. Interested friends must read it!
When the server side of Ajax responds to data with PrintWriter out=resp.getWriter (), out.print (0) and out.print (1) indicate success or failure instead of out.write for a reason. First, let's take a look at the similarities and differences between print and write.
What they have in common is that neither of them refreshes the page, but only writes data on the original page. In the end, the write method in the abstract class Writer is rewritten.
The difference is that the print method can convert various types of data into string output. The overloaded write method can only output character-related data such as characters, character arrays, strings, and so on.
So it is not difficult to find the difference between the two above, in the js code of the page, the callback function is based on the value returned from the server to determine what should be displayed, if the last output in the server-side servlet is the number, and if writ is used, then the number will not be converted into a string output, resulting in an incorrect judgment of the return value on the page.
The above is all the content of the article "sample Analysis of the end output Stream of servlet in Ajax Technology". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
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.