java - pass error message from action method to jsp -


this action method containing business logic. want show error message action method in jsp. control goes jsp error message not show up.in jsp have code display error message:

<html:errors/> 

i new struts. in eclipse says saveerrors method deprecated. know how display errors using validate method of bean class extends actionform.

 public actionforward upload(....)     {      if(noofcolumns>7)                   {                       errors.add(actionerrors.global_error, new actionmessage("error.file.maxcols"));                       saveerrors(request,errors);                       return mapping.findforward("uploadvipprocess");                   }     } 

the docs explicitly state do:

deprecated. use saveerrors(httpservletrequest, actionmessages) instead.

this removed after struts 1.2.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -