Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActionForm Validate Error

Status
Not open for further replies.

xfolquet

Programmer
Nov 9, 2004
2
ES
Hi, I have an Action and its ActionForm but when the Validate catch an Exception I put: er.add("CodInfo",new ActionError("error.ModificarApliInformacionForm.valor.required")); The value "error.ModificarApliInformacionForm.valor.required" is in com.myApp.properties.MessageResources.properties. The view(input) includes this: <html:errors /> But when an error has been produced: org.apache.jasper.JasperException: Cannot find bean informacion in any scope I tried in the JSP: <html:errors property="CodInfo" /> but its the same error I think that The hashMap ActionErrors can't be created but I don't know why. I have more Actions with ActionForms ang go OK? Any help?
 
Hi,
try the ActionMessage
errors.add( "name", new ActionMessage( "error.name.required" ) );


ActionError
Deprecated Classes:
org.apache.struts.action.ActionError
Please use ActionMessage instead, deprecated since 1.2.0.
 
Thank's but I have discovered the reason, the input jsp is loaded by a ValueObject(bean) and when the validation fails the bean is not in scope (the action put it in request). I solved It puttig the bean in session, but there's a better solution?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top