Resource not found exception

Hi,

    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.


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

that path should be relative to Velocity's resource loader path
0
 
srujanmiryalaAuthor Commented:
So could you suggest me what's the path should i use
0
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.