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 helpvery small mounts of station-keeping from its maneuvering thrusters 1, 2).
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
Lower your volume before watching (cued at 05:31
):