塔塔二的gravatar头像
塔塔二 2019-01-14 15:00:39
ERROR [500.jsp] - Failed to instantiate standard serializer

最近使用ajax跳转到后台的时候,报了如题所示的错误,在网上找了很久没找到答案,现在我把我的答案分享一下

ERROR [500.jsp] - Failed to instantiate standard serializer

 

如图所示是我的ajax,    之所以会错是因为我的后台代码,因为我不需要返回数据,所以我后台就没有写return

 @RequestMapping("fileExample")

@ResponseBody

public void fileExample() throws IOException {

        System.out.println("你好呀");

}

 

这是错误代码

以下是正确的

 @RequestMapping("fileExample")

@ResponseBody

public String fileExample() throws IOException {

        System.out.println("你好呀");

        return adminPath;

}

 

对比一下就知道问题在哪了

 


打赏
最近浏览
dawei_man  LV2 2020年12月7日
asxdkhjdbnsjhbfcd  LV10 2020年1月23日
saber996  LV1 2019年6月30日
fanshaohai  LV3 2019年4月23日
xay1997  LV2 2019年4月11日
梓嘉一心一意ZYPeng丶  LV5 2019年4月10日
java_con  LV3 2019年3月24日
我是好衣服  LV6 2019年3月18日
cc_xuquan  LV2 2019年3月18日
SherJ1950  LV13 2019年3月16日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友