Yes, wars get a nation out of a recession, even a depression.
This was the case in 1939, when the US war machine started gearing up in response to WWII. After the war there was an immediate recession, however the wealth and industry created from the war allowed the country to grow for the next several decades, until the end of Bretton Woods and the beginning of true money printing allowed the US to print its way to prosperity.
Again in 2003, with the economy having sunk from the Internet Bubble, the escalation of the war on terror allowed the economy to grow again.
Increased defense spending pumped an additional 200 Billion dollars a year since the start of the war into the US Defense industry, which allowed Defense contractors to funnel money into other US industrial businesses, providing employment for millions of people.
This increase in spending, in addition to lower interest rates fueled the housing boom, and subsequent bubble, which burst in 2007.
With the War on Terror winding down in terms of spending and Obama cutting back on defense spending, at a time when money printing will likely not solve the problem faced currently, the economy will contract again at least in terms of purchasing power parity, likely with the Fed's delayed outlook on inflation, it will never officially be called a 'depression' simply because it is in a inflationary environment.
Understanding global economics/politics in this manner is important in understanding how the world really works. US debt and currency is backed by US military power, and in turn the US economy is backed by US military spending. This allows the US to consume more than it produces, exporting wealth abroad to other nations such as China, Russia, Japan, and the EU zone.
The defense budget, in terms of size represents a 'bailout' every year of roughly 550 Billion (1000-1200 Billion in total including energy/war/research spending). A decrease in this number of a few hundred billion as seen recently will result in a drastic number of job losses as programs are terminated and products go unconsumed by the defense sector and their many and numerous industrial partners, as well as the products consumed by workers employed.
Money removed from defense spending and allocated in other growing industries is less effective in creating jobs as those industries have yet to gear themselves appropriately to demand and growth, although in time (10-20 years) feasibility may be achieved. Additionally, reallocated money used to bailout financial institutions has not stopped job losses, or increased job growth in that industry as the last six months have shown continuing deteriorating economic conditions. The market reversal of the last half of the year is considered by many an effect of money printing/inflationary environment as well as part of a natural Fibonacci trading cycle/euphoria stemming from Christmas spending outlook and further bailouts as well as the hope that the economic decline stops in 2010, as well as automated machine trading/short squeezes used to bolster market conditions.
In summary, War is essential for economic growth at this point for America, either in acquiring Oil assets, backing the US Dollar, and creating jobs.
By sending 30k troops to Afghanistan and not completely slashing war funding, Obama is acknowledging this, although democrats refuse to understand that declining defense expenditures will result in deteriorating economic conditions, at a point in time when deteriorating economic conditions are the norm.
Likely at this point, we are on the verge of a depression (or inflationary depression) in which the only way out within the next 10 years is a large scale war involving millions of Americans, and many trillions in Defense expenditures.
War gets a nation out of a recession, War can keep a nation out of a recession, War grows an economy, War advances scientific knowledge and understanding.