About Development Master 2004 No. 8, <JSP Create a Web-based Dynamic Chart> One's a little error in one article

xiaoxiao2021-03-06  68

Declaration, this error is found in the practice process, does not mean that there is no solution.

In the jsp directStream = response.getOutputStream = response.getoutputstream = response.getOutputStream (); then logs image information to this output. In actual operation, tomcat will report an error, I don't know how the author is solved. After study, I found this The problem is that JSP is formed when the JSP is converted to servlet, and the RESPONSE output stream (I am so understandable) is also converted to the run after the servlet, which will cause an error in the Tomcat background. But the front desk can also output the picture stream.

After the servlet is changed, since the method can be controlled to doget, Dopost, you don't have to translate it into a servlet without JSP, running the servlet directly, which will not report an error.

Moreover, the servlet can be equipped into a variety of URLs. In the current project, it is an intended image stream output directly, then generates a picture stream output, and then calls "IMG SRC =" / makepic / output.jpg in the web page. PicName = XXX "" "Run. You can achieve image synthesis; and other items share a set of pictures, not to put the picture under the root directory. Still there are many benefits.

There is also one. In the article, SUN package is used. This is not recommended, there is a method, using Java package, next modification.

Perhaps there is a solution in JSP ... or maybe I didn't look at this article carefully .. Because the article is published, it is just a problem before the day. I am too lazy to see again. :)

转载请注明原文地址:https://www.9cbs.com/read-120347.html

New Post(0)