I was looking on the internet and this is what I found... it looks like pretty good advice..
Toddlers do all sorts of things to themselves when they're frustrated: they bite the backs of their hands, bang their heads, hit themselves, and throw themselves to the ground. Head slapping falls into this category of normal tantrum behavior and is nothing to worry about.
How best to respond? It's helpful to respond to your child's emotions by using the words that describe what you think he is feeling, for example saying: "you're really angry" or "you're very frustrated." Then tell your son gently, "Please don't hurt yourself--I don't like to see anything hurting you" and perhaps hold him gently, so that he feels contained and protected.
Mainly your attitude is what is important, and it should be calm, supportive, and caring. You are teaching your son lessons that he will remember for life. Whenever he faces frustration in the future, he'll call on the memory of the reassuring way you dealt with his tantrums when he was a toddler, and the memory will help him to stay in control of himself. He'll also call on the memory of your supportive, warm response when he has to deal with other people's upsets; it will make him a more empathetic person.
http://www.drspock.com/faq/0,1511,2640,00.html