That can be sticky. A lot of places have thousands of users who all appear to the webserver as being at the same IP address. Even my own site has half a dozen, and it's just a SOHO setup.
There are a number of JSF captcha tags available right now, so displaying and filtering via captcha is easy. If you truly want to grab IP addresses, you could build a hashtable in the backing bean, add IPs as they come in, and set the "rendered" attribute on the captcha according to whether the entry is new or a repeat.
An IDE is no substitute for an Intelligent Developer.