36 lines
1.0 KiB
Java
36 lines
1.0 KiB
Java
package com.amarsoft.app.als.image;
|
|
|
|
import java.awt.image.BufferedImage;
|
|
import java.io.IOException;
|
|
|
|
import javax.imageio.ImageIO;
|
|
import javax.servlet.ServletException;
|
|
import javax.servlet.http.HttpServlet;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
public class BarCodeServlet extends HttpServlet{
|
|
|
|
private static final long serialVersionUID = 332233L;
|
|
|
|
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
|
|
throws ServletException, IOException {
|
|
doPost(req, resp);
|
|
}
|
|
|
|
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
|
|
throws ServletException, IOException {
|
|
|
|
String TypeNo = req.getParameter("TypeNo");
|
|
String TypeName = req.getParameter("TypeName");
|
|
|
|
// String code = TypeNo+TypeName;
|
|
// System.out.println(code);
|
|
// BufferedImage image = QRUtil.getBarcode(TypeNo, 600, 150);
|
|
BufferedImage image = QRUtil.getRQ(TypeNo, 90);//Éú³É¶þάÂë
|
|
|
|
ImageIO.write(image, "png", resp.getOutputStream());
|
|
|
|
}
|
|
}
|