John Brown's Body and the melody came first - I have read the melody was written by William Steffe.
The battle hymn of the republic was written by Mrs Julia Ward Howe and published in 1862 - her name was not printed and her payment was just 5 dollars.
Anne