Turns out that I could get this to work by adding the following file to my project:
.settings/org.eclipse.wst.common.component
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="test1">
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<property name="context-root" value="test1"/>
<property name="java-output-path" value="/test1/build/classes"/>
</wb-module>
</project-modules>
I found this out by creating a brand new "Dynamic Web Project":
- "File | New | Dynamic Web Project"
- Go through the steps until you get to the last one called "Web Module"
- There I could specify a "Content Directory" for the app, and I used "src/main/webapp/".
- This generated a new project that worked as I liked. I then searched the project folder for "src/main/webapp" and found it in this xml file, which I just copied into my project, and changed all references from "test1" to my projects name, and it worked!
Note: You may also need to add "Web App Libraries" to your project as detailed in my question.