Ajax background Normal execution error type is 404

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.