How did Confucianism become the state ideology of China?

               Rulers often rely on religion. The great Han emperor Wu-Di made Confucianism the state religion. He realized that Confucianism would foster Han rule. Kong Zi or Confucius who lived between 551 and 479 BC was the founder of Confucianism. Confucianism called for a life of virtue. Ren or humanity, yi or righteousness, li or ritual, zhi or knowledge and xin or integrity are the pillars of Confucianism. People were asked to be polite and respectful to one another. They were expected to serve their ruler. Emperor Wu-Di made knowledge of Confucianism compulsory for the civil services examination of his time.