Speaking at an event marking China's hosting of the Winter Olympics, Mr Xi said some athletes said China deserved a gold medal for its approach.
China's zero-Covid policy has come under strain with infections surging and signs of public anger.
Shanghai's 25 million residents remain under lockdown.
On Friday, the city - China's financial hub - announced a record 21,000 cases. An official said that out of 130,000 infections during the current outbreak, just one person was considered to be in a "severe condition".
The low numbers of serious cases have led some to ask whether a lockdown is necessary, says BBC China correspondent Stephen McDonell.
In the north-eastern Jilin City, officials there said that the city had reached "Social Zero Covid" after 33 days of lockdown. But residents there have been given no indication when restrictions will be lifted.
China is one of the last remaining nations still committed to eradicating Covid, in contrast to most of the world which is trying to live with the virus in its Omicron variation.
Shanghai residents have taken to social media to complain about food supplies.
People in the city are confined to their homes, and most have to order in food and water and wait for government drop-offs of vegetables, meat and eggs.
But the lockdown extension has overwhelmed delivery services, grocery shop websites and even the distribution of government supplies.
Political scientist Dali Yang of the University of Chicago suggested several million people in Shanghai were running low on supplies and many were restricted to eating one meal a day.
He warned that elderly Shanghainese, who were more likely to live alone and less likely to use smartphones, were among those most at risk.
Meanwhile, a video showing a worker in a hazmat costume beating a dog to death with a shovel has caused revulsion online.
The dog's owner had reportedly been taken to quarantine after testing positive for Covid and had left the pet outside in the hope that it would survive.
In his speech, Mr Xi said China's zero Covid policy had withstood the test of the Winter Olympics.
There is little sign of China changing its approach. An editorial in state news agency Xinhua said the country would "firmly adhere" to its policy.
"It will not be long before Chinese citizens affected by the virus can enjoy warm sunshine in spring days as things get back to normal," it said.