Java – meaning and solution of spring 3 error message “getresponsebodyasstream is recommended”

I am using spring 3. Every time I submit an HTML form to the spring control, I receive this message. I don't understand:

org.apache.commons.httpclient.HttpMethodBase getResponseBody
WARNING: Going to buffer response body of large or unkNown size. 
Using getResponseBodyAsStream instead is recommended.

Are there any configuration changes I can avoid in spring?

Solution

This happens with the Commons httpclient API when using the getresponsebody () method Warning means that the response body may be very large (such as large file download, etc.) and load the entire content into memory at one time, because string may be very inefficient The way to avoid this potential inefficiency is to use getresponsebodyasstream (), which will allow proper buffering and streaming of response bodies

I don't know why spring is using getresponsebody() Could it be your HTTP client? Do you use a custom HTTP client to execute the request?

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>