zoukankan      html  css  js  c++  java
  • Could not find acceptable representation

     Resolving exception from handler [null]: org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation
    Resolving exception from handler [null]: org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation
     Resolving exception fromhandler[null]:org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation
    springframework.web.servlet.DispatcherServlet - Null ModelAndView returned to DispatcherServlet with name 'spring': assuming HandlerAdapter completed request handling

    因为@RequestMapping(value="/backend/loadUserTypeList.html",produces={"test/html;charset=UTF-8"})中test/html 写错  改为text/html
        @ResponseBody        
        public Object loadUserTypeList(@RequestParam(value="s_roleId",required=false) String s_roleId){
            String cjson="";
            try {
                DataDictionary dataDictionary=new DataDictionary();
                dataDictionary.setTypeCode("USER_TYPE");
                List<DataDictionary> userTypeList=dataDictionaryService.getDataDictionaries(dataDictionary);
                for(DataDictionary d:userTypeList){
                    logger.debug("rtrtrtrtrtrtrryryrytyrytryt"+d.getTypeName());
                }
                JSONArray jo=JSONArray.fromObject(userTypeList);
                cjson=jo.toString();
            } catch (Exception e) {
                // TODO: handle exception
                e.printStackTrace();
            }
            return cjson;
        }

  • 相关阅读:
    Spring AOP 随记
    Java设计模式系列 — 构造器模式
    【Java线程安全】 — 常用数据结构及原理(未完结)
    【最佳实践】好用的Quartz管理器类
    Timer和时间调度
    Java9之HashMap与ConcurrentHashMap
    记一次maven的包冲突经历
    hbase高可用集群部署(cdh)
    HBase 1.2.6 完全分布式集群安装部署详细过程
    hadoop-2.7.3完全分布式部署
  • 原文地址:https://www.cnblogs.com/pangting/p/7460154.html
Copyright © 2011-2022 走看看