I include this in my velocity file. but it is not working,
< img src="cid:src/resources/imageContent.jpg" />
I include this in my velocity file. but it is not working,
< img src="cid:src/resources/imageContent.jpg" />
When your server is running you can get path till server from request.getContexPath();
So here you just need to provide rest path of the image. I have done this for my demo application like this.
<img border="0" alt="Test" src="${projectPath}/images/logo.jpg"/></a></td>
Now you have to set value of projectPath to your projectPath which you can get by request.getContexPath();
Now create one Map in which you have to add Key which will keyword that you have used in .vm file. For this example, we have used projectPath.
Map map = new HashMap<>();
map.add("projectPath",request.getContexPath());
map.add() // other value that you want to replace in vm file
After that create instance of VelocityContext load this map with constructor argument like this
VelocityContext velocityContext = new VelocityContext(map);