Ultraviolet (UV) photonics-based device and equipment have various applications in sterilization, military covert communication, medical treatment, nanofabrication, gem identification and so on. The traditional constituent UV components are bulky, inefficient, expensive and easily aging under UV radiation. An all-dielectric metasurface offers a promising way to control the amplitude, polarization and phase of light by engineering the size, shape and distribution of its constituent elements. However, UV components based on all-dielectric metasurfaces are difficult to be realized, due to significant absorption loss for most dielectric materials at the UV region. Here we demonstrate the design of a UV metalens, composed of high-aspect-ratio aluminum nitride nanorods. The in-plane on-axis, off-axis and out-of-plane focusing characteristics have been investigated at representative UVA (375 nm), UVB (308 nm) and UVC (244 nm) wavelengths, respectively. Furthermore, we design UV router for mono-wavelength and multiple wavelengths, that is, guiding UV light to designated different spatial positions. Our work is promising for the development of UV photonic devices and would facilitate the integration and miniaturization of the UV nanophotonics.