The Star Fox (London, 1968), about a war against an alien species, has a happy ending. The second novel, Fire Time, features a war against another alien species - and a genuinely different alien species, not a mere repetition.
Anderson's happy endings are good for mankind and for the individual hero. First, as regards mankind:
"'If man is going to live throughout the galaxy, he's got to be free to take his own roads, the ones his direct experience shows him are best for his circumstances. And that way, won't the race realize all its potential? Is there any other way we can, than by trying everything out, everywhere?'" (p. 201)
This passage projects a fulfilled further future for mankind but also makes us want to read another sequel set in that further future.
As regards the hero - Gunnar Heim, having won the war, has become a citizen of the colony planet, New Europe (like New York or Nova Scotia writ large):
"'...a whole new world, elbow room, infinite possibilities.'" (p. 202)
When he has retired as the New European minister of space and the navy, Heim will:
experiment with pelagic farming;
prospect other planets and asteroids;
start a merchant spaceship yard;
do more -
- a natural leader in peace and war.
SM Stirling's Nantucket Trilogy Volume III ends with a major war won and several characters, now rich, planning the farms that they will build and own in South America. But another kind of sequel is also hinted at. The main villain has been killed but his daughter has survived and plans revenge...
The message may be that there will always be war? I do not agree that there will always be war but I do agree that we must always be prepared for unforeseen disasters, including renewed conflicts. Even if our descendants build a peaceful utopian civilization in the Solar System, they will never be sure that the Merseians or the kzinti are not going to arrive in the next interstellar invasion fleet - or the Draka from an alternative timeline? A utopian civilization should:
know its own history;
understand historical change and the role of the unpredictable in historical processes;
be prepared to adjust to major changes.
Larry Niven showed in "The Warriors," that technology can be turned back to destructive purposes. Lasers used for propulsion or asteroid defense can be turned against invading spaceships. The optimum human being will be someone who fully enjoys all the benefits of technology while also being able to adjust to the requirements of survival in the event of the loss of technology.