There is an interesting article at vox.com about the Brussel's attack, and how radical islamism and jihadism has risen not only outside, but also inside of Europe itself. The gist of it is that we have allowed a situation where there are essentially immigrant/islamic ghettos within our cities, the people in these ghettos are forming isolated communities that have a very separationist mentality, and they are radicalizing themselves. They are being preached by radical islamists into hating the west, the very countries they live in. This is one of the reasons why so many terrorist attacks are actually committed by jihadists who are citizens of the country, sometimes even second or third generation (ie. they were themselves born, or even their parents may have been born, in the country, and thus they are natural-born citizens.) Not all terrorist attacks are committed by foreigners coming from the outside into the country for the express intent of committing the attack. The problem is aggravated by the fact that in most European countries there aren't enough resources to combat this: Police and special task forces are growing thin as they are, and the global economic crisis is not doing any favors either. Not to talk about the economic and social impact of the migrant crisis.
The question arises: What could be done about it? In practice, or even in theory.
The problem with this is that anything that could be done would break one or several of the core principles of our free constitutional societies.
Should we just ban islamic preaching? This would blatantly break the constitutional principle of freedom of religion. Should we dismantle the immigrant ghettos and force their inhabitants to move elsewhere? Again, this goes against the constitutional principle that everybody should have the freedom to live wherever they want, and not be forced by society to live somewhere else. Should we just deport all muslims? This just cannot be done for natural-born citizens (especially since there is nowhere to deport them to; they don't have a home country other than their current one, where they were born). For immigrants who have got citizenship this is not so clear-cut (because they have a country of origin), but still has problematic consequences from a constitutional and human rights perspective. Deporting non-citizens is a possibility, but then it becomes a question of who should and shouldn't be deported. Certainly we can't deport people simply because of their religion (which would, once again, be blatantly unconstitutional.)
Closing our borders for all immigration is, perhaps, the only action that's not blatantly unconstitutional (for any constitution I know of). However, while it might help a bit, it's not going to fix the problems we already have. There are already radical islamist ghettos in our countries, and they are becoming larger and more numerous by the day. Cutting the influx of immigrants is not going to change that by much.
Maybe there is no solution to the problem. Maybe we have already f***ed up ourselves beyond all hope. Maybe jihadism and terrorism has become an integral part of European society, and there's little we can do about it. Maybe it's too late to do anything about it, at least without us regressing to anti-constitutional totalitarianism.
The only future I see for Europe is either total economic collapse, which would plummet Europe into complete chaos where nobody is safe, and millions of people will have to live in poverty and die from starvation, with probably islamists making coups d'etats all over Europe, or the rise of one or more extreme right regimes akin to nazi Germany of the 1930's and 40's, and possibly ensuing civil wars. Either way, the idyllic constitutional free welfare states of Europe, which we built during the last 50 years, will be gone.
We are f***ed. And we mostly did this to ourselves.