You can use some triarii and principes to hold them, then run the hastati around the back of the enemy, make pincushions of them and then charge them from behind. They don't like that a lot.