This may sound stupid or too simple but.
I read reports and stories from Belgium, Germany France, UK, Netherlands about imams having inflammatory sermons in mosques and religious schools being funded by Saudi Arabia which teach bout radical islam and call for revenge on the West and that sort of stuff.
After every attack stories like that pop out. So surely police in those countries already know about those places and about certain indviduals who teach young people about that stuff and encourage them to go on the attacks like last night's. Is the work about that lacking, are those imams being interrogated, jailed, punished? Are those mosques and schools being closed? Or they pop out in such numbers they can't be all closed? I'm just wondering does the countries' police and secret service doing enough to solve or try to solve the root of the problems.
Of course other problems are education or the lack of it. Poverty and lack of life chances are the breeding space for this kind of crazy ideas and young brains are easily poisoned. Everybody must do their part so at least someof the attacks or most of it are prevented.
Of course one of the solutions, the big one, would be to West to cut all the ties with Saudi Arabia and proclaim them enemy number one but that won't happen ever...