Generate .war file from web app containing just HTML, CSS & JavaScript

前端 未结 2 1158
清酒与你
清酒与你 2021-02-14 12:22

I am trying to create a war file that will be deployed on a web/application server.

The source files of the app are purely HTML, CSS, and JavaScript. There is a separat

2条回答
  •  名媛妹妹
    2021-02-14 12:32

    If you are creating a war file, then you are deploying on a Java based web application server, something like Tomcat or Wildfly.

    If you are using eclipse, you can do so by New > Dynamic Web Project (maybe name it foo-bar), click next, next and finish. Then open that foo-bar project and create your css and js folders under WebContent like so.

    \WebContent\css
    \WebContent\js
    \WebContent\index.html
    \WebContent\foo-bar.html
    

    You can right click the foo-bar project > Export > Web WAR file.

    When you deploy it on say Tomcat, you can test to access your static content like so

    http://localhost:8080/foo-bar/css/foo-bar.css
    http://localhost:8080/foo-bar/js/foo-bar.js
    http://localhost:8080/foo-bar/foo-bar.html
    

    Hope this helps.

提交回复
热议问题