array(2) { ["docs"]=> array(10) { [0]=> array(10) { ["id"]=> string(3) "428" ["text"]=> string(77) "Visual Studio 2017 单独启动MSDN帮助(Microsoft Help Viewer)的方法" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(8) "DonetRen" ["tagsname"]=> string(55) "Visual Studio 2017|MSDN帮助|C#程序|.NET|Help Viewer" ["tagsid"]=> string(23) "[401,402,403,"300",404]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511400964" ["_id"]=> string(3) "428" } [1]=> array(10) { ["id"]=> string(3) "427" ["text"]=> string(42) "npm -v;报错 cannot find module "wrapp"" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(4) "zzty" ["tagsname"]=> string(50) "node.js|npm|cannot find module "wrapp“|node" ["tagsid"]=> string(19) "[398,"239",399,400]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511400760" ["_id"]=> string(3) "427" } [2]=> array(10) { ["id"]=> string(3) "426" ["text"]=> string(54) "说说css中pt、px、em、rem都扮演了什么角色" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(12) "zhengqiaoyin" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511400640" ["_id"]=> string(3) "426" } [3]=> array(10) { ["id"]=> string(3) "425" ["text"]=> string(83) "深入学习JS执行--创建执行上下文(变量对象,作用域链,this)" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(7) "Ry-yuan" ["tagsname"]=> string(33) "Javascript|Javascript执行过程" ["tagsid"]=> string(13) "["169","191"]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511399901" ["_id"]=> string(3) "425" } [4]=> array(10) { ["id"]=> string(3) "424" ["text"]=> string(30) "C# 排序技术研究与对比" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(9) "vveiliang" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(8) ".Net Dev" ["catesid"]=> string(5) "[199]" ["createtime"]=> string(10) "1511399150" ["_id"]=> string(3) "424" } [5]=> array(10) { ["id"]=> string(3) "423" ["text"]=> string(72) "【算法】小白的算法笔记:快速排序算法的编码和优化" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(9) "penghuwan" ["tagsname"]=> string(6) "算法" ["tagsid"]=> string(7) "["344"]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511398109" ["_id"]=> string(3) "423" } [6]=> array(10) { ["id"]=> string(3) "422" ["text"]=> string(64) "JavaScript数据可视化编程学习(二)Flotr2,雷达图" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(7) "chengxs" ["tagsname"]=> string(28) "数据可视化|前端学习" ["tagsid"]=> string(9) "[396,397]" ["catesname"]=> string(18) "前端基本知识" ["catesid"]=> string(5) "[198]" ["createtime"]=> string(10) "1511397800" ["_id"]=> string(3) "422" } [7]=> array(10) { ["id"]=> string(3) "421" ["text"]=> string(36) "C#表达式目录树(Expression)" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(4) "wwym" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(4) ".NET" ["catesid"]=> string(7) "["119"]" ["createtime"]=> string(10) "1511397474" ["_id"]=> string(3) "421" } [8]=> array(10) { ["id"]=> string(3) "420" ["text"]=> string(47) "数据结构 队列_队列实例:事件处理" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(7) "idreamo" ["tagsname"]=> string(40) "C语言|数据结构|队列|事件处理" ["tagsid"]=> string(23) "["246","247","248",395]" ["catesname"]=> string(12) "数据结构" ["catesid"]=> string(7) "["133"]" ["createtime"]=> string(10) "1511397279" ["_id"]=> string(3) "420" } [9]=> array(10) { ["id"]=> string(3) "419" ["text"]=> string(47) "久等了,博客园官方Android客户端发布" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(3) "cmt" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511396549" ["_id"]=> string(3) "419" } } ["count"]=> int(200) } 222 SpringMVC的页面几种返回方式 - 爱码网
package com.boventech.learning.controller;  
  
import java.util.HashMap;  
import java.util.Map;  
  
import org.springframework.stereotype.Controller;  
import org.springframework.ui.Model;  
import org.springframework.web.bind.annotation.RequestMapping;  
import org.springframework.web.bind.annotation.RequestMethod;  
import org.springframework.web.bind.annotation.RequestParam;  
import org.springframework.web.bind.annotation.ResponseBody;  
import org.springframework.web.servlet.ModelAndView;  
  
import com.boventech.learning.entity.User;  
  
/** 
 * MVCReturn 
 * @author peng.xia 
 * 
 */  
@Controller  
@RequestMapping("/MVCReturn")  
public class SpringMVCReturnController {  
      
    @RequestMapping(value="/index1",method=RequestMethod.GET)  
    public ModelAndView index(){  
        ModelAndView modelAndView = new ModelAndView("/user/index");  
        modelAndView.addObject("name", "xxx");  
        return modelAndView;  
    }  
    //对于ModelAndView构造函数可以指定返回页面的名称,也可以通过setViewName方法来设置所需要跳转的页面;  
      
    @RequestMapping(value="/index2",method=RequestMethod.GET)  
    public ModelAndView index2(){  
        ModelAndView modelAndView = new ModelAndView();  
        modelAndView.addObject("name", "xxx");  
        modelAndView.setViewName("/user/index");  
        return modelAndView;  
    }  
    //返回的是一个包含模型和视图的ModelAndView对象;  
      
    /** 
     * Model一个模型对象, 
     * 主要包含spring封装好的model和modelMap,以及java.util.Map, 
     * 当没有视图返回的时候视图名称将由requestToViewNameTranslator决定;  
     * @return 
     */  
    @RequestMapping(value="/index3",method=RequestMethod.GET)  
    public Map<String, String> index3(){  
        Map<String, String> map = new HashMap<String, String>();  
        map.put("1", "1");  
        //map.put相当于request.setAttribute方法  
        return map;  
    }  
    //响应的view应该也是该请求的view。等同于void返回。  
      
    //返回String  
    //通过model进行使用  
    @RequestMapping(value="/index4",method = RequestMethod.GET)  
    public String index(Model model) {  
        String retVal = "user/index";  
        User user = new User();  
        user.setName("XXX");  
        model.addAttribute("user", user);  
        return retVal;  
    }  
      
    //通过配合@ResponseBody来将内容或者对象作为HTTP响应正文返回(适合做即时校验);  
    @RequestMapping(value = "/valid", method = RequestMethod.GET)  
    @ResponseBody  
    public String valid(@RequestParam(value = "userId", required = false) Integer userId,  
            @RequestParam(value = "name") String name) {  
        return String.valueOf(true);  
    }  
    //返回字符串表示一个视图名称,这个时候如果需要在渲染视图的过程中需要模型的话,就可以给处理器添加一个模型参数,然后在方法体往模型添加值就可以了,  
      
       
    @RequestMapping(method=RequestMethod.GET)  
    public void index5(){  
        ModelAndView modelAndView = new ModelAndView();  
        modelAndView.addObject("xxx", "xxx");  
    }  
    //返回的结果页面还是:/type  
    //这个时候我们一般是将返回结果写在了HttpServletResponse 中了,如果没写的话,  
    //spring就会利用RequestToViewNameTranslator 来返回一个对应的视图名称。如果这个时候需要模型的话,处理方法和返回字符串的情况是相同的。  
  
}  

 

  1. package com.boventech.learning.controller;  
  2.   
  3. import java.util.HashMap;  
  4. import java.util.Map;  
  5.   
  6. import org.springframework.stereotype.Controller;  
  7. import org.springframework.ui.Model;  
  8. import org.springframework.web.bind.annotation.RequestMapping;  
  9. import org.springframework.web.bind.annotation.RequestMethod;  
  10. import org.springframework.web.bind.annotation.RequestParam;  
  11. import org.springframework.web.bind.annotation.ResponseBody;  
  12. import org.springframework.web.servlet.ModelAndView;  
  13.   
  14. import com.boventech.learning.entity.User;  
  15.   
  16. /** 
  17.  * MVCReturn 
  18.  * @author peng.xia 
  19.  * 
  20.  */  
  21. @Controller  
  22. @RequestMapping("/MVCReturn")  
  23. public class SpringMVCReturnController {  
  24.       
  25.     @RequestMapping(value="/index1",method=RequestMethod.GET)  
  26.     public ModelAndView index(){  
  27.         ModelAndView modelAndView = new ModelAndView("/user/index");  
  28.         modelAndView.addObject("name""xxx");  
  29.         return modelAndView;  
  30.     }  
  31.     //对于ModelAndView构造函数可以指定返回页面的名称,也可以通过setViewName方法来设置所需要跳转的页面;  
  32.       
  33.     @RequestMapping(value="/index2",method=RequestMethod.GET)  
  34.     public ModelAndView index2(){  
  35.         ModelAndView modelAndView = new ModelAndView();  
  36.         modelAndView.addObject("name""xxx");  
  37.         modelAndView.setViewName("/user/index");  
  38.         return modelAndView;  
  39.     }  
  40.     //返回的是一个包含模型和视图的ModelAndView对象;  
  41.       
  42.     /** 
  43.      * Model一个模型对象, 
  44.      * 主要包含spring封装好的model和modelMap,以及java.util.Map, 
  45.      * 当没有视图返回的时候视图名称将由requestToViewNameTranslator决定;  
  46.      * @return 
  47.      */  
  48.     @RequestMapping(value="/index3",method=RequestMethod.GET)  
  49.     public Map<String, String> index3(){  
  50.         Map<String, String> map = new HashMap<String, String>();  
  51.         map.put("1""1");  
  52.         //map.put相当于request.setAttribute方法  
  53.         return map;  
  54.     }  
  55.     //响应的view应该也是该请求的view。等同于void返回。  
  56.       
  57.     //返回String  
  58.     //通过model进行使用  
  59.     @RequestMapping(value="/index4",method = RequestMethod.GET)  
  60.     public String index(Model model) {  
  61.         String retVal = "user/index";  
  62.         User user = new User();  
  63.         user.setName("XXX");  
  64.         model.addAttribute("user", user);  
  65.         return retVal;  
  66.     }  
  67.       
  68.     //通过配合@ResponseBody来将内容或者对象作为HTTP响应正文返回(适合做即时校验);  
  69.     @RequestMapping(value = "/valid", method = RequestMethod.GET)  
  70.     @ResponseBody  
  71.     public String valid(@RequestParam(value = "userId", required = false) Integer userId,  
  72.             @RequestParam(value = "name") String name) {  
  73.         return String.valueOf(true);  
  74.     }  
  75.     //返回字符串表示一个视图名称,这个时候如果需要在渲染视图的过程中需要模型的话,就可以给处理器添加一个模型参数,然后在方法体往模型添加值就可以了,  
  76.       
  77.        
  78.     @RequestMapping(method=RequestMethod.GET)  
  79.     public void index5(){  
  80.         ModelAndView modelAndView = new ModelAndView();  
  81.         modelAndView.addObject("xxx""xxx");  
  82.     }  
  83.     //返回的结果页面还是:/type  
  84.     //这个时候我们一般是将返回结果写在了HttpServletResponse 中了,如果没写的话,  
  85.     //spring就会利用RequestToViewNameTranslator 来返回一个对应的视图名称。如果这个时候需要模型的话,处理方法和返回字符串的情况是相同的。  
  86.   
  87. }  

相关文章: