Resource not found exception


    Iam trying to create a sample spring mvc application and now iam facing an error because of below code

String text=VelocityEngineUtils.mergeTemplateIntoString(velocityEngine,"/WEB-INF/jsp/agentmail.vm",messageModel);

At this point of code i'am getting the error:
org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource '/WEB-INF/jsp/agentmail.vm'

the vm is placed is correctly under WEB-INF/jsp folder. Could any one help me what's the correct path needs to be used to retrieve this file.

Who is Participating?
you need to move the vm into your loader path which I assume is at WEB-INF/classes
> "/WEB-INF/jsp/agentmail.vm"

that path should be relative to Velocity's resource loader path
srujanmiryalaAuthor Commented:
So could you suggest me what's the path should i use
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.