javascript - Eclipse - How do I publish non-Java resources without a web.xml file? -
request.getRequestDispatcher ("/ web-INF / test / testpage.html") forward (request, response);
This works, but I can not get additional resources (javascript) from the server.
& lt; Script type = "text / javascript" src = "testsuite.js" & gt; & Lt; / Script & gt;
is located in testuite.js /WEB-INF/test/testsuite.js, the folder as a single testpage.html. I get 404 when requesting testuite.js. How can I configure tomcos to serve all the resources of my work tree without webcam? The worst case I will just embed JS
In addition, I will install the Web server on my local machine, so I do not know how they are deployed.
You must transfer resources outside of your WEB-INF
folder There is a special folder for compiled Java code, jar, configuration files etc.
The web-INF
folder is restricted to server and servlet containers for security reasons, for example /appname/WEB-INF/web.xml
A request for will definitely be removed.
Static resources such as *. Html
files, *. CSS
files, *. Files, images etc. should be excluded from the
WEB-INF
folder, in your case
Web-INF
.
Comments
Post a Comment