通过URL接受图片并展示
【通过URL接受图片并展示】通过RestTemplate访问指定的URL地址接收数据。将图片在界面展示出来。
PictureController.java
package cn.cw.controller;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import cn.cw.util.DateUtil;
@Controller
@RequestMapping("/picture")
public class PictureController {@Value("${cma.history.pictureUrl}")
private String url;
@RequestMapping("/index.do")
@ResponseBody
public ModelAndView index() {return new ModelAndView("biz/picture");
}@RequestMapping("/getPicture.do")
@ResponseBody
public String getPicture(HttpServletRequest request) {String id = request.getParameter("terminalId");
String begin = request.getParameter("begin");
String end = request.getParameter("end");
JSONObject resultJson = new JSONObject();
List
picture.html
历史图片查询 - 锐客网
推荐阅读
- gitlab|gitlab 通过备份还原 admin/runner 500 Internal Server Error
- whlie循环和for循环的应用
- 接受不完美的自己
- 如何通过锻炼的方法治疗前列腺肥大
- 通过复盘快速成长(附模板)
- 你为什么不愿坦诚接受别人的赞美()
- MyBatis|MyBatis Generator配置
- 运维|如何限制IP 通过 SSH连接服务器
- 运维|Linux 禁止用户或 IP通过 SSH 登录
- 青椒板书--足球