import java.io.*; public class HelloWorld implements MiniServlet { PrintWriter out; String arg; public void setOutputStream(OutputStream o) { out = new PrintWriter(new OutputStreamWriter(o)); } public void setArg(String s) { arg = s; } public void run() { out.println("HTTP/1.0 200 "); // Version & status code out.println("Content-Type: text/plain"); // The type of data we send out.println(); // End of response headers out.println("Hello " + arg); out.close(); } }