We study the Josephson effect in ballistic double-barrier SIFIS planar junctions, consisting of bulk superconductors (S), a clean metallic ferromagnet (F), and insulating interfaces (I). We solve the scattering problem based on the Bogoliubov-de Gennes equations and derive a general expression for the dc Josephson current, valid for arbitrary interfacial transparency and Fermi wave vectors mismatch (FWVM). We consider the coherent regime in which quasiparticle transmission resonances contribute significantly to the Andreev process. The Josephson current is calculated for various parameters of the junction, and the influence of both interfacial transparency and FWVM is analyzed. For thin layers of strong ferromagnet and finite interfacial transparency, we find that coherent (geometrical) oscillations of the maximum Josephson current are superimposed on the oscillations related to the crossovers between 0 and π states. For the same case we find that the temperature-induced 0 − π transition occurs if the junction is very close to the crossover at zero temperature.