This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ValidatorForm exception in struts framework  RSS feed

 
M Burke
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I set an ActionError to the ActionErrors collection, I get an unknown exception in the struts framework after validate() returns. I am using Struts 1.2.9. Any ideas?

public ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
{
ActionErrors errors = new ActionErrors();

String actionMethod = request.getParameter(UIGridGlobal.REQID_METHOD);

if (hiddenCurrentEvent != null && hiddenCurrentEvent.compareTo(UIGridGlobal.USER_EVENT_SEND_FORM) == 0){

if(priceBeginDate == null || priceBeginDate.compareTo("") == 0){
errors.add("no review action", new ActionError("errors.grid.ui.priceBeginDate"));
}

if(selectedDealers == null || selectedDealers.length == 0){
errors.add("no review action", new ActionError("errors.grid.ui.selectedDealers"));
}

}

return errors;
}
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The ActionError class has been deprecated in Struts Version 1.2.9. Use ActionMessage instead. Note that only ActionError is deprecated. ActionErrors is still good.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!