Four men have been jailed following the attack that took place on a beach.