Eclipse + Tomcat - Serve webapp directly from workspace

后端 未结 9 700
旧时难觅i
旧时难觅i 2021-02-04 10:13

What is the ideal way to configure Tomcat to serve directly from my project\'s directory inside of my workspace? (related)

I want my static web resources

9条回答
  •  旧时难觅i
    2021-02-04 11:07

    This depends on whether you object to taking some action, like hitting Publish, or if you object to the copy happening even if it's transparent. Static content like CSS, HTML or JavaScript should get automatically deployed (i.e. copied) when you save, assuming you have "Automatically publish when resources change" under "Publishing" selected in Tomcat's server configuration. You should refresh in your browser and see the changes, barring some browser caching.

    If you truly want Tomcat to look directly at your project's static files, then run Tomcat with nothing deployed (unless you have Java classes to deploy in the same project) and edit the server.xml file under Servers > Apache Tomcat v7.0 at localhost-config and add some Context elements under Host like this:

    
    

提交回复
热议问题