java
奋斗的青蛙
爱学习的小青蛙
展开
-
使用枚举类enum代替switch
使用枚举类enum代替switch使用枚举类,能大大减少switch的代码量,提高代码阅读性public enum TestEnum { stu1("小明", "一班"), stu2("小红", "二班"), stu3("小丽", "一班"), stu4("小刚", "三班"), stu5("小敏", "一班"), stu6("小帅", "二...原创 2019-05-03 22:51:10 · 2484 阅读 · 0 评论 -
springmvc与springboot设置ajax跨域No 'Access-Control-Allow-Origin' header is present on the requested
springmvc与springboot设置ajax跨域No 'Access-Control-Allow-Origin' header is present on the requestedSpringMVC与springboot通用版设置跨域response.setHeader(“Access-Control-Allow-Origin”, “*”);response.setHeader(“...原创 2019-05-08 18:02:19 · 1076 阅读 · 0 评论 -
springmvc接收ajax get,post请求数据(简单版)
get请求参数:127.0.0.1:8080/doGet?name=“haha”@GetMapping("/doGet")public AjaxResult doGet(@RequestParam("name")String name){ return AjaxResult.Success("成功:"+name);}post请求参数:路径:127.0.0.1:8080/doPo...原创 2019-05-16 22:50:35 · 1259 阅读 · 0 评论