The Admor of Munkatch wrote that Davening for peace lengthens the Exile. One should Daven not for peace but for Geulah (Darchei Chaim Ve-Shalom p. 213). He based this idea on the words of the Chatam Sofer that praying for peace delays the Geulah, as our Sages say: "War is also Atchalta De-Geulah (Beginning of the Redemption)" (Megillah 17b). One should therefore Daven for the Geulah and not fear war at all (Sefer Ha-Zicharon, 5717 edition, p. 53).
Atchalta De-Geulah includes building Eretz Yisrael, the return to Eretz Yisrael, the establishment of the State of Israel, unity in the Nation - and also war. To our great distress, in our day there is no free nation without war. It is for this reason that the Rambam called one of his books Hilchot Melachim U-Milchamot - Laws of Kings and Wars (according to uncensored edition). In it he describes the Mashiach as a man of war (Ibid. Chapter 11-12).
It is written at the end of the Book of Yeshayahu (63:6): "I stepped on nations in My anger and made them drunk with My wrath, and I brought down their power to the earth". There is a ridiculous claim among university scholars that there were two Yeshayahus: One who pursued war and one who pursued peace, as it says at the beginning of Yeshayahu (2:4): "They shall beat their swords into plowshares and their spears into pruning hooks, nation will not lift up sword against nation and they will not learn war anymore". But if there were swords and spears, it is a sign that they did wage war.
We understand why people do not want wars: because our brothers/dear soldiers are killed. People then say: "This is a time of distress for Yaakov"! When we were in Exile and Jews were killed, that was a time of distress. But now it is a time of war, and people are killed in war. There is no Divine promise anywhere in the Torah that people will not fall in war. On the contrary, in King David's army, the soldiers wrote Gittin - divorce documents - for their wives in case they were killed in action but their bodies were not found (Shabbat 56a. Ketubot 9a). And when Rabbenu Ha-Rav Tzvi Yehudah was asked about fallen soldiers during the Yom Kippur War, when perhaps a hundred-fold more soldiers fell, he responded: Where is your contract?! Where is the contract that Hashem signed for you that we would not be killed in war?! This can be compared to one who purchases an apartment for half a million Shekels. Do we say it is a time of distress? He is out half a million Shekels! When we wage war, when we destroy our enemy and when we build our Nation's security, the price we pay is the lives of some of our soldiers. Everything in the world has a price. This time is not defined as a "time of distress for Yaakov" but a "time of salvation for Yaakov"! When our enemies attack, we hit back one-thousand-fold.
Then should we Daven for War? No, we should Daven for Geulah. We do not tell Hashem what to do. We always pray in the general. When we recite the prayer "Refa’enu - Heal us" in the Shemoneh Esrei, we do not instruct Hashem how to heal us, which medicine or therapy to use. We leave it up to Him. We do not enter into details, but pray in general.
There was once a man who had no livelihood. He came to a Chasidic Rebbe and told him: I bought a lottery ticket. The Rebbe said: I'll pray that you win the jackpot. The man got cold feet, however, since the ticket was so expensive and he sold it. The ticket won. The Rebbe took this as a rebuke from Heaven for the way that he acted and he went to his Rebbe and told him that he was leaving the Rabbinate. His Rebbe told him: No, no, but don't dictate to Hashem how to solve problems. We pray in general.
The Chatam Sofer and the Admor of Munkatch therefore said not to pray for Peace, since it delays the Geulah. After all, "War is also Atchalta De-Geulah".
And may the verse be fulfilled: "No longer will violence ("Hamas" in Hebrew) be heard of in your Land, nor plunder and calamity in your borders, and you will call [Hashem's] salvation your protective walls, and [His] praise to be your gateways" (Yeshayahu 60:18).