Which application context set in IntelliJ IDEA for Tomcat?

被刻印的时光 ゝ 提交于 2019-12-10 10:38:51

问题


So far I run Tomcat server (v. 7.0.26) in windows command by catalina.bat start script. If I want to deploy my web app I have to build it by Maven and copy WARs to specify Tomcat deploy directory. When server start everything is ok.

Now I try to connect my web app to IntelliJ IDEA Ultimate 2017.1.4. My app have multiple WARs. At Run/Debug Configuration I add new Tomcat Server. At the Deployment tab I have:

I have to choose Application context but if I set blank for more than one artifact I get error Duplicate context path''. Same situation is when I choose /. If I try to run server nothing deploy. Which application context I should set?


回答1:


The application context will be part of the URL you have to enter in your browser when accessing the application. You could use the name of your war file:

kb-hook

Then you can enter the adress in your browser and find the application. (Given your Tomcat runs on port 8080) You will maybe have to add a path to a resource within the war behind that URL.

http://localhost:8080/kb-hook/

You could also choose another name, but the name of the war file is chosen quite often.



来源:https://stackoverflow.com/questions/44633560/which-application-context-set-in-intellij-idea-for-tomcat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!