Background execution Importexcel, clear method execution success, but the front desk is prompt 404
@RequestMapping ("/import")
The public Json importexcel (@RequestParam (value= "file", Required=true) commonsmultipartfile file,httpservletrequest req, String exp1, String modeltype) {
String[] Str=commonservicei.getobjectid (3, req);
Str[0]createby str[1]createdepartment Str[2]createarea
list<tjsamilardto> LTJ = Tblicenceporductservice.importdata (File,exp1,modeltype, str[0],str[1],str[2]);
/*string path = "";
if (Modeltype.equals ("Hazardous Chemical Safety Production License")) {
Path = "/license/chemicalsporduct";
}else if (modeltype.equals ("Hazardous Chemicals Safe Use license")) {
Path = "/license/chemicalsuse";
}
return path; */
JSON j = new JSON ();
if (Ltj.isempty ()) {
J.SETEXP1 ("0");
J.setmsg ("Import succeeded! ");
}else{
J.SETEXP1 ("1");
J.setmsg ("There" +ltj.size () + "bar data due to the enterprise name in the system does not match the success of the import, whether to download the view! ");
}
J.setlist (LTJ);
J.setsuccess (TRUE);
Return J;
}
Reason:
Annotation @responsebody The role of this annotation, which is to return the function as a request value.
Without this annotation, the response to the request should be a page, which should be added if the page is not needed.
Ajax background Normal execution error type is 404