IntelliJ and Tomcat.. Howto..?

后端 未结 7 1361
忘掉有多难
忘掉有多难 2020-11-27 10:34

Using Netbeans, I develop sites with Tomcat as the local server to manage it. In Netbeans it was \"Install, write hit Run and it works\" How do I pull the same thing off in

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-27 11:15

    Here is step-by-step instruction for Tomcat configuration in IntellijIdea:

    1) Create IntellijIdea project via WebApplication template. Idea should be Ultimate version, not Community edition

    enter image description here

    2) Go to Run-Edit configutaion and set up Tomcat location folder, so Idea will know about your tomcat server enter image description here

    3) Go to Deployment tab and select Artifact. Apply enter image description here

    4) In src folder put your servlet (you can try my example for testing purpose) enter image description here

    5) Go to web.xml file and link your's servlet like this

    enter image description here

    6) In web folder put your's .jsp files (for example hey.jsp)

    enter image description here

    7) Now you can start you app via IntellijIdea. Run(Shift+F10) and enjoy your app in browser:

    - to jsp files: http://localhost:8080/hey.jsp (or index.jsp by default)

    - to servlets via virtual link you set in web.xml : http://localhost:8080/st

提交回复
热议问题