How do you put the pictures in the war archive?



  • I've got relative paths on the local install to the picture folder, but I noticed that this folder is not in war, as a consequence, not displayed in the list of images on the server. How do you include pictures, add a folder of pictures in war (what way?) or write absalute ways and keep pictures somewhere else?



  • If you don't use the front line in the form. apache / nginx to provide access to static resources, they should be in the WAR file. References to static resources should be made on the basis of ContextPath

    Any collection system, like https://maven.apache.org/ or http://gradle.org/ may place files from the external catalogue in WAR at the app assembly stage, but it would be much more logical if they were placed automatically.

    For example, Maven does. https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html Annexes. If your images are in the catalogue. src/main/webapp/static/imageswhen the application is deployed, they will be available in absolute terms http(s)://<ipaddr:port>/${pageContext.servletContext.contextPath}/static/images or relative /${pageContext.servletContext.contextPath}/static/images Reference

    In this example ContextPath specified using JSTL♪ Depending on the framing used and the markings, there are ways to do it differently.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2