The excitation of giant resonances in electron and proton scattering