How to Deploy to Intellij IDEA Tomcat Folder?

好久不见. 提交于 2019-12-21 04:01:17

问题


I use Intellij IDEA 11.1.2 Ultimate Edition. I run Tomcat 6 from Intellij IDEA. Beside my .war application I have another folder that has static HTML files. When I run tomcat manually from command line I put that folder under Tomcat's webapp folder and it automatically deploys it and works. However I want to debug my application so I want to run Tomcat from Intellij IDEA. I think that Intellij IDEA deploys tomcat applications into .IntelliJIdea11\system\tomcat folder. Where I can put my folder that contains static files when I run Tomcat from Intellij IDEA?

(I request the main page of static HTML file folder within an iframe at one of my HTML pages of .war file )

Any ideas?


回答1:


Tomcat Run configuration has an option to deploy other applications from the server (that already present in the original webapps folder), like your static files:

Another option would be to create a second module for the static content with another artifact and deploy both artifacts from IntelliJ IDEA.




回答2:


I think that CrazyCoder's answer is a little bit better. But here is my solution.

  • Go to File -> Project Structure...
  • Select your Web facet
  • In section Web resource directories click to +
  • Web resource directory path is your static content
  • Relative path in deployment directory is where you want to find it in your application war




回答3:


If you want to debug you have no need to run Tomcat from IDEA. You can use remote debugging feature. Just set up Tomcat to accept debug(listen to particular port). And create debug configuration from IDEA to attach to this port.



来源:https://stackoverflow.com/questions/12949191/how-to-deploy-to-intellij-idea-tomcat-folder

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