Hitler (far right, seated) with his army comrades of the Bavarian Reserve Infantry Regiment 16 (c. 1914–18)
During his service at headquarters, Hitler pursued his artwork, drawing cartoons and instructions for an army newspaper. During the Battle of the Somme in October 1916, he was wounded in the left thigh when a shell exploded in the dispatch runners' dugout. Hitler spent almost two months in hospital at Beelitz, returning to his regiment on 5 March 1917. On 15 October 1918, he was temporarily blinded in a mustard gas attack and was hospitalised in Pasewalk. While there, Hitler learnt of Germany's defeat, and—by his own account—upon receiving this news, he suffered a second bout of blindness.
Hitler described the war as "the greatest of all experiences", and was praised by his commanding officers for his bravery. His wartime experience reinforced his German patriotism and he was shocked by Germany's capitulation in November 1918. His bitterness over the collapse of the war effort began to shape his ideology. Like other German nationalists, he believed the Dolchstoßlegende (stab-in-the-back myth), which claimed that the German army, "undefeated in the field", had been "stabbed in the back" on the home front by civilian leaders and Marxists, later dubbed the "November criminals".
The Treaty of Versailles stipulated that Germany must relinquish several of its territories and demilitarise the Rhineland. The treaty imposed economic sanctions and levied heavy reparations on the country. Many Germans saw the treaty as an unjust humiliation—they especially objected to Article 231, which they interpreted as declaring Germany responsible for the war. The Versailles Treaty and the economic, social, and political conditions in Germany after the war were later exploited by Hitler for political gain.
(source)