Are you trying to redirect the user with an error from within the execute() method of an Action class? If you are doing this method one looks fine. When you redirect the user to the page via the forward the <html:errors> tag will check to see if an ActionErrors collection (properly keyed in the request or session of course) is present. If the ActionErrors collection is present, it will render the error output.
If you are trying to add an error from a validate() method, you can just create an ActionErrors collection, add the Action error and return it. Struts will automatically redirect you back to the JSP page it came from if it an ActionErrors collection is returned of size < 0.
Please let me know if that does not answer the question.
John Carnell - Senior Engineer, Genesys PureCloud Division
Author of Spring Microservices in Action