Resonances in one-dimensional disordered systems: localization of energy and resonant transmission