Hello there,
To be honest, I can't see any reason to convert this to a JSP. You're
generating binary data and you're going to have to use Java code for this
anyway; a Servlet is the way to proceed.
Richard Huss
Technical Editor, Wrox Press Ltd
richardh@w...
www.wrox.com
p2p.wrox.com
www.wroxconferences.com
www.asptoday.com
-----Original Message-----
From: Hareesh [mailto:venkata_hareesh@y...]
Sent: Friday, September 01, 2000 11:25 AM
To: Pro_JavaServer_Pages
Subject: [pro_jsp] servlet to jsp conversion of ceration of dynamic
image
Hi, I am using windows 98, javawebserver2.0,jdk1.2, jsdk2.0. Can any one
give a solution to convert this program to jsp?
import java.io.*;
import java.awt.*;
import javax.servlet.*;
import javax.servlet.http.*;
import Acme.JPM.Encoders.GifEncoder;
public class test1 extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException , IOException {
ServletOutputStream out = res.getOutputStream();
Frame frame = null;
Graphics g = null;
try{
frame = new Frame();
frame.addNotify();
Image image = frame.createImage(400,60);
g=image.getGraphics();
g.setFont(new Font("Serif", Font.ITALIC,48));
g.drawString("Hello World!",10,50);
res.setContentType("image/gif");
GifEncoder encoder = new GifEncoder(image,out);
encoder.encode();
}finally{
if(g !=null) g.dispose();
if(frame != null ) frame.removeNotify();
}
}
}
---
Do you know what you want from this list? How would you provide programmers
with the solutions they need? If you have the answers, and are willing to
work in Birmingham (UK), then you could be a List Manager. Please send CVs
and a covering letter to listsupport@p... for further information.