TAIPEI, Taiwan — Russia’s brutal war in Ukraine has jolted Taiwan into confronting the specter of a sudden attack from the island’s own larger and more powerful neighbor: China.The invasion has given new weight to the authoritarian vision of China’s leader, Xi Jinping, who has long laid claim to self-governed Taiwan for the “rejuvenation” of China — much as President Vladimir V. Putin of Russia did with Ukraine. To many in Taiwan, Ukraine has been a lesson in the tactics and weaponry that could slow a more powerful invading force. It has also been a stark warning that the island may be inadequately prepared for a full-scale attack.Taiwan’s defenses are, by many accounts, ill-equipped and understaffed. Its president, Tsai Ing-wen, has vowed to defend the island, but she has struggled to impose a new strategic vision on the uniformed leadership.Taiwan spends billions on fighter jets and submarines, yet its conscripts barely get enough ammunition for training. The mandatory military service is seen by many as too short, and the reservist program, insufficiently rigorous. The military is building a professional force, but has struggled to recruit and retain highly skilled soldiers.Now, Ukraine has been an impetus for change.Steven Lee Myers contributed reporting from Seoul.