Pls give me an idea, how to convert this following code to jsp
Pls give me an idea, how to convert this following code to jsp. it can works well when i run under the ide. i just want to show the result in internet explorer. please give me a basic tip how to do it. am very new to java
**********************
My Os: WindowsXP
MyServer: Apache Tomcat 5.5.17 Server
My IDE: NetBeans 5.0
*********************
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.InetAddress;
import java.net.MulticastSocket;
public class MulticastClient {
public static void main(String[] args) throws IOException {
MulticastSocket socket = new MulticastSocket(4446);
InetAddress address = InetAddress.getByName("230.0.0.1");
socket.joinGroup(address);
DatagramPacket packet;
// get a few quotes
for (int i = 0; i < 5; i++) {
byte[] buf = new byte[256];
packet = new DatagramPacket(buf, buf.length);
socket.receive(packet);
String received = new String(packet.getData());
System.out.println("Quote of the Moment: " + received);
}
socket.leaveGroup(address);
socket.close();
}
}

