A series of deadly attacks carried out by militants across Europe over the past year have fueled a debate about how to handle the influx of hundreds of thousands of refugees and other migrants propelled by civil war in Syria, Iraq and Libya.