How to create a web app in Idea with gradle

Posted by GeniusV on March 14, 2017
  1. choose File -> new -> project
  2. choose Gradel
  3. choose SDK
  4. choose Java and Web on the right panel
  5. choose next
  6. enter GroupId and Aritfictid
  7. change Version to 0.0.1-SNAPSHOT
  8. choose next
  9. choose Gradle JVM
  10. choose next
  11. confirm name and location
  12. choose Finish
  13. wait for gradle to complete
  14. add servlet-dependency to build.gradle
  15. choose Gradle and click refresh button
  16. check if the dependency is installed
  17. create a java dictonary in main dictionary, which shoudld become a root dictionary automatically.
  18. create WEB-INF dictionary in webapp dictionary.
  19. create web.xml in WEB-INF. If there is no template, choose Edit File Templates. Then, create a template in files, and copy Code -> Other -> Web -> Deployment descriptors -> Web.3_1.xml to the template and press OK
  20. choose Edit Configuration (beside the run button), add a Local Tomcat Server.
  21. Configure the Tomcat Server if is necessary.
  22. choose depolyment and add a artifact having a explored at the end.
  23. the application context is recommened
  24. Choose Server. On Update action and On frame deactication both choose Update classes and resources.
  25. choose apply
  26. Done !