Diet's definitely the most important! Weight loss is something like 80% diet ad 20% exercise, so you could spend hours and hours in the gym, but if you're living on a diet of high fat/sugar stuff, you'll never lose the weight!
I think exercise is still important, it's what keeps us healthy and strong, but you can lose a lot of weight without too much exercise. (not that I'm reccomending it

but I did hardly do any exercise whilst losing all my weight!)