日期:2014-05-17 浏览次数:20611 次
String qrtext = request.getParameter("doctor"); String qrtext2 = request.getParameter("subject"); ByteArrayOutputStream out1 = QRCode.from(qrtext).to( ImageType.PNG).stream(); ByteArrayOutputStream out2 = QRCode.from(qrtext2).to( ImageType.PNG).stream(); response.setContentType("image/png"); response.setContentLength(out1.size()); //response.setContentLength(out2.size()); OutputStream outStream = response.getOutputStream(); outStream.write(out1.toByteArray()); //outStream.write(out2.toByteArray()); outStream.flush(); outStream.close();