There is a special kind of idiocy behind statements like this, around which I have an extreme difficulty to wrap my head, especially coming from the US defence establishment.
First, I don't mean to be an ass, but I don't remember Iraq war being some sort of stellar success story, from which all of us are supposed to take notes.
Second, completely different situations. In Iraq the US was the liberator (such as it was...) from an oppressive regime, which had very little popular support, and US was perceived as such and welcomed (at least in the beginning). Hamas is very much a popular movement in the Territories (and especially in Gaza), whilst Israel is the enemy. We are not trying to "liberate" anybody or "win hearts and minds", we are trying to crash an essentially massively popular movement, whose end goal is Israel complete obliteration. Nobody was trying to win hearts in minds in Japan or Germany prior to surrender, and this is where we are at.