Israel launched the offensive in Gaza in December of 2008 to stop Palestinian militant rocket attacks on Israeli towns .