The Italians led at the break thanks to 13 points from fly-half Joe Carlisle but two tries early in the second half from Richard Smith and Kristian Dacey gave the home side control.
However, it was far from plain sailing for the Blues after a Francesco Minto double got the visitors back into the match.
But Rory Watts-Jones scored to wrap up the points for Blues and Hammett was quick to praise his side's efforts.
"The last few weeks we have been superb from a preparation perspective, but I think last week we missed the intensity in the game," he said.
"Tonight we prepared well after a short turnaround and I thought the boys were good in terms of our intensity.
"I felt we learnt the lessons of last week, we were more composed and we didn't put anyone in the rucks so we could maintain our line. We showed good signs.
"We had talked about how critical it was that we got a win. It was important to win at home and hopefully last week was just a blip because we had been going on the up."
Click here to view the best images from Cardiff's victory over the Treviso
Follow us on Facebook, join the conversation on Twitter, sign up to ourYouTube channel for extensive match highlights and sign up for our newsletter for regular updates on the GUINNESS PRO12
However, it was far from plain sailing for the Blues after a Francesco Minto double got the visitors back into the match.
But Rory Watts-Jones scored to wrap up the points for Blues and Hammett was quick to praise his side's efforts.
"The last few weeks we have been superb from a preparation perspective, but I think last week we missed the intensity in the game," he said.
"Tonight we prepared well after a short turnaround and I thought the boys were good in terms of our intensity.
"I felt we learnt the lessons of last week, we were more composed and we didn't put anyone in the rucks so we could maintain our line. We showed good signs.
"We had talked about how critical it was that we got a win. It was important to win at home and hopefully last week was just a blip because we had been going on the up."
Click here to view the best images from Cardiff's victory over the Treviso
Follow us on Facebook, join the conversation on Twitter, sign up to ourYouTube channel for extensive match highlights and sign up for our newsletter for regular updates on the GUINNESS PRO12