When learned to make JSP pages, I was taught to use a common menu page separate from all other pages and then import the menu page to each page using <jsp:directive.include file="menu.jspx" />.
Is there a similar way to do this in HTML5? Or is there a better way to include a common menu/masthead on every page using HTML5?
No, html5 doesn’t do this.
What you were doing in JSP was a server-side include.
What you are asking for is a client-side include, those don’t exist in html5.
I you had a good reason for loading something client-side, you could use javascript.
Look into AJAX. A lot of .js libraries have good support, to make it easier.
jQuery for example has a load() function which takes some of the pain away.
I don’t recommend using something like that for a navigation menu though.
Server-side includes would be better.
If you’re simply working on a small project, maybe you’re doing it locally, and you just want to make it so you don’t have to copy-paste chunks of the page everywhere, php is an easy way to do it.
Use something like XAMPP to run php on your machine in an easy-to-follow way.
Then use php’s include function, as demonstrated here: PHP Include to do what you want.