sevelet在后台生成了微信支付的二维码图片,怎么传给前台,我是一个新手,老师留的大作业,就差微信支付没做了,这是后台生成的二维码,怎么在前台调用,这是后台生成二维码的代码 try {
int width = 200;
int height = 200;
System.out.println("123");
String format = "png";
Hashtable hints = new Hashtable();
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
BitMatrix bitMatrix = new MultiFormatWriter().encode(code_url, BarcodeFormat.QR_CODE, width, height, hints);
OutputStream out = null;
out = response.getOutputStream();
MatrixToImageWriter.writeToStream(bitMatrix, format, out);
out.flush();
out.close();
http://blog.csdn.net/u012418896/article/details/44021351
将二维码保存到服务器然后得到路径,用流io取出写到前台!
看你代码思路没错,就是将二维码文件输出到response相应流里面去的。