The pasuk says והעיר שושן צהלה ושמחה. This was before the war happened yet, so how could they rejoice, they didn't know they were going to win?
The answer must be they were confident in the (צהל(ה and the סם חיה the Torah which is compared to סם חיים-- the שׂ & ס are interchangeable. They were confident in their torah and that they would be able to fight the war.
The question is, Torah and tefilah have a lot more to do with success in battle than fighting. So why does the pasuk say the צהל first, if they put their trust in Hashem in the zechus of Torah?