Exercise is the second key. In fact regular exercise is the single best predictor of long term success in weight maintenance. Sedentary behavior is a major problem and one of the main causes of rising obesity. 30 min of exercise per day is key. Those who can do at least 2000 calories of exercise per week have the best chance of not gaining weight.
Motivation is the last, but most important key.
Important when you begin a diet, and it remains most important in the long run. Motivation is very individual. You can motivate some people by scaring them, but mostly we are motivated by seeing positive results. The one advantage of a rapid, visible weight loss is its motivating effect. How safe is weight reduction.