Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to reference images in Velocity templates  RSS feed

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello.

I just put together a standard Spring servlet-type project with a standard Maven project structure. All works fine, except i can't figure out how to reference my image files from my Velocity templates. My image folder is:
myproject\src\main\webapp\WEB-INF\images and my Velocity templates are in myproject\src\main\webapp\WEB-INF\vm

The application is packaged into an ear file and deployed in OC4J.

I tried every path i could think of, including these:



 
Mats Andersson
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bump. Anyone please?
 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing that's inside of WEB-INF can be accessed directly by the client (you can test that by trying that URL in a browser); you'll need to move the images directory to somewhere outside of WEB-INF.
 
Sheriff
Posts: 21288
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or use a URL mapping in the web.xml file for it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!