Ding was born in Shanyang (present-day Huai'an), Jiangsu province. Although not awarded an official post, he was an important figure in the defense of Shanyang from the British in 1842, during the First Opium War. He also helped to rebuild the city's walls after the attack. As a result, he was appointed secretary of the Grand Secretariat in 1843.[1]
The following decade, Ding again organised a militia to defend the city from the Taipeng Rebellion. However, he was accused of incompetence, and was banished. This ruling was later overturned, and he was given responsibility for civilian military training, eventually reaching the second rank.[1] His sons Shou-ch'ang and Shou-ch'i also served in public office.[2]
Despite his military accomplishments, Ding was best known as a scholar of the Classics. His Shang shu yu lun made the case for the forgery of the Shu ching, and he made many key arguments in favour of Wu Cheng'en being the original author of the Buddhist classic Journey to the West.[3][4] He authored over fifty books on scholarly subjects, and was the director of two literary academies.[2] Many of his works were compiled and published in 1862 as the Yi zhi zhai cong shu (Collected works of Yizhizhai Studio).[1]