jsp项目里如何给画图方法传参

public void paint(Graphics g) {
Integer width=800,height=800;
BufferedImage buffImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
g = buffImg.createGraphics();

    // 将图像填充为白色
    g.setColor(Color.WHITE);
    g.fillRect(0, 0, width, height);

    // 画边框。
    g.setColor(Color.red);
    g.drawRect(0, 0, width - 1, height - 1);

    g.setColor(Color.red);
    g.drawString("画图sd类", 200, 180);
    //直接输出到浏览器,这两句是必须设置的
}

如何给这个方法传参来调用它使得可以在网页中画出来

类似这个
https://www.cnblogs.com/zhouguanglin/p/7398670.html
https://blog.csdn.net/weixian52034/article/details/52186207

只是画的东西不同
另外,这里后面验证判断,你也不需要了。