Highly sensitive and selective detection of 2,4-DNT, a representative explosive, was achieved by the synergic effect of molecular imprinting and host (cyclodextrin)-guest interaction in ultrathin layers of TiO(2) and SiO(2) gel; the detection limit using cSPI measurements reached nM concentration.