Palestinian violence predates the 1967 and 1948. Also Gaza wasn't occupied since Israel left it in 2005.
Here's is one example from 1954 when Israel did not control Gaza or the West Bank: https://en.wikipedia.org/wiki/Ma%27ale_Akrabim_massacre
"The Ma'ale Akrabim massacre, known in English as the Scorpions Pass Massacre, was an attack on an Israeli passenger bus, carried out on 17 March 1954, in the middle of the day. Eleven passengers were shot dead by the attackers who ambushed and boarded the bus. One passenger died 32 years later of his injuries, in a state of paralysis and partial consciousness. Four passengers survived, two of whom had been injured by the gunmen."
Palestinians are largely in the reality they're in due to the violence.