How to send data from WebWork action to velocity template?


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();

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?

1 Like

@daniel @david.pinn @jechlin @jobinkk
Guys can anyone help me with this?

1 Like

Found answer to my problem here: