• 使用@ResponseBody 出现错误Could not find acceptable representation


    org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representatio

     
     

    org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation

    at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:115)

    at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:80)

    at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:94)

    at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:74)

    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)

    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)

    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)

    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)

    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)

    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)

    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)

    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)

    at javax.servlet.http.HttpServlet.service(HttpServl

    ?

    ?

    解决办法 为 ResponseBody 加上getter方法

    http://www.rritw.com/a/bianchengyuyan/C__/20130605/322468.html

  • 相关阅读:
    Ubuntu 16.04 安装 .NET Core[转]
    SQL Server 2012提供的OFFSET/FETCH NEXT与Row_Number()对比测试 [T]
    npm package
    RN 文件上传下载
    RN css整理
    react nginx配置
    macOS安装homebrew报错 errno 54 & port 443:Connection refused
    shopify插件开发oauth报400的解决办法
    Mac下更新Ruby版本
    Failed to connect to raw.githubusercontent.com port 443 解决方案
  • 原文地址:https://www.cnblogs.com/softidea/p/5912774.html
Copyright © 2020-2023  润新知