Japanese Prime Minister Shinzo Abe visited the controversial shrine, which China and South Korea say glorifies war criminals.