java - Packaging Javascript files in a war? -


i developing servlet based java project packaged war using maven. there way can include javascript (js) files along project (they should available @ url when project loads on tomcat server).

i have looked around have not found working solutions.

maybe better solution stick maven convention, specifies root directory of web application src/main/webapp.

so if put javascript files in src/main/webapp/javascript (or src/main/webapp/js), integrated in final war package.

in maven war plugin, give descriptions (see here example) content of directories. example:

 |-- pom.xml  `-- src      `-- main          |-- java          |   `-- com          |       `-- example          |           `-- projects          |               `-- sampleaction.java          |-- resources          |   `-- images          |       `-- sampleimage.jpg          `-- webapp              |-- web-inf              |   `-- web.xml              |-- index.jsp              `-- jsp                  `-- websource.jsp 

as can see, can put resources in webapp/xxx directory, such jsp file here.

as stated cuh, can configure maven war plugin if directory structure different.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -