I touched up your project and got it working in a Tomcat instance declared through IntelliJ. For the purpose I sent you a pull request: https://github.com/bigalnz/ptest/pull/1. Just merge it and you should be fine. A lot of the issue you are facing involve around the basic knowledge about Gradle conventions. Please read the following pages to get up to speed:
- https://docs.gradle.org/current/userguide/java_plugin.html
- https://docs.gradle.org/current/userguide/war_plugin.html
To get the web application started in the IDE:
- Generate the project files via
./gradlew idea
- Open the project file
ptest.ipr
. - Generate the web application archive with
./gradlew build
. - Configure Tomcat and point to the generated archive under
build/libs
. - Start Tomcat. Your index page and your
/form
page should work.
As you can see we are using a lot of the files that have been generated by the Gradle build and not IntelliJ. That’s what I meant with interoperability issues earlier. I am sure you can also configure the web artifact in IntelliJ and use that. However, that’s more a question for JetBrains. I am not sure where they stand with the functionality.