The interaction of the electromagnetic field with lossless Lorentz oscillators modeling the inhomogeneous dielectrics is diagonalized in a closed Fabry-P\'erot resonator using the generalized polariton transformation. Resulting dispersion relations coincide with the classical ones obtained by the solution of the wave equation. The corresponding decomposition is, however, orthogonal and complete in the enlarged Hilbert space. \textcopyright{} 1996 The American Physical Society.