日期:2014-05-17  浏览次数:20611 次

QR code 儲值問題
Java code
 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();

只儲一個值就正常地產生出來,但是儲多一個值,圖就不能生產出來
有什麼辦法做到?

------解决方案--------------------
特殊分割字符而已,不喜欢就用:
String all = a + '\n' + b;