Java – HttpServletRequest #getremoteaddr() returns null

Why HttpServletRequest Getremoteaddr() sometimes returns null? For about 2 identical requests, null is returned for no obvious reason

Solution

Use Tomcat 7 Obviously, if the request has been consumed, getremoteaddr () can return null, that is, the response has been sent It can even throw NPE In any case, my code has errors

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
分享
二维码
< <上一篇
下一篇>>