We present a concept for performing direct parity measurements on three or more qubits in microwave structures with superconducting resonators coupled to Josephson-junction qubits. We write the quantum-eraser conditions that must be fulfilled for the parity measurements as requirements for the scattering phase shift of our microwave structure. We show that these conditions can be fulfilled with present-day devices. We present one particular scheme, implemented with two-dimensional cavity techniques, in which each qubit should be coupled equally to two different microwave cavities. The magnitudes of the couplings that are needed are in the range that has been achieved in current experiments. A quantum calculation indicates that the measurement is optimal if the scattering signal can be measured with near single photon sensitivity. A comparison with an extension of a related proposal from cavity optics is presented. We present a second scheme, for which a scalable implementation of the four-qubit parities of the surface quantum error correction code can be envisioned. It uses three-dimensional cavity structures, using cavity symmetries to achieve the necessary multiple resonant modes within a single resonant structure.