I had a foam-filled rest (a bit like your first example, though without the bit which goes under the keyboard) and I found it more a hindrance than a help. I do have a mousemat with a wrist rest on it which I find very useful.
The most useful aid to me is the Microsoft split keyboard. I find it very comfortable and easy to use, and now find it difficult to use the standard keyboard for any length of time. I have a split keyboard on my home and work PCs.
http://www.amazon.com/Microsoft-A11-00337-Natural-Keyboard-Elite/dp/B0000642RX (Here's) an example of it from Amazon.