• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to reference images in Velocity templates  RSS feed

 
Mats Andersson
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?
 
Lester Burnham
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.
 
Rob Spoor
Sheriff
Posts: 21133
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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!