I have a webwork action that does a bunch of work and return “success” to render a success.vm or “error” to render a error.vm velocity template. In case of errors, I have to collect all the errors and display them on the velocity template. How do I transfer the data from servlet to my velocity template?
I have used VelocityContext (org.apache.velocity.VelocityContext) to add my errors to the context.
VelocityContext velocityContext = new VelocityContext(); velocityContext.internalPut("projectNotFound","APD");
Now in the error.vm, I have used $projectNofFound to display the project key “APD”. But instead, it just prints “$projectNotFound”.
Project : $projectNotFound not found!! Please update your child projects list.
How do I get the $projectNotFound value?