Basically, it would not be orbiting L2 in a Keplerian orbit sense. There is no mass at L2 for the spacecraft to orbit, you are correct in that sense. The JWST would be in a solar orbit in that would normally be a little longer than one year and would use the contours of the gravitational fields from the Earth and the Sun around the Earth-Sun L2 point to keep it moving around the sun in a predictable region near the L2 point, and that deliberately planned gravitational perturbation is what will keep the JWST in a 1:1 resonance with Earth around the Sun, (along with some station-keeping help from its maneuvering thrusters). As a result, when seen from the Earth, the satellite would appear to be moving in a curve around the L2 point. https://en.wikipedia.org/wiki/James_Webb_Space_Telescope#Orbit