Starship Troopers was written by Robert Heinlein, who attended a service academy and was an officer before WWII. The fact that it's science fiction somewhat obstructs the satire present, namely citizens' relationship to war and violence as a national value. The movies are basically entirely unrelated in this way.
e: Heinlein wasn't in the Navy during WWII.