From: Stefan K. <st...@ya...> - 2006-11-01 13:16:03
|
Hi=0A=0AI am new to jetty 6 and I need to do http uploads from my Flash App= lication to a http server. The Server app is a threaded Socket server commu= nicating with Flash.=0A=0AThis is my code so far: (I am running jetty embed= ded along side the socket server).=0A=0Apublic static void main(String[] ar= gs) {=0A=0A Server server =3D new Server(8080);=0A server.add= Handler(new HTTPHandler());=0A try {=0A server.start();= =0A server.join();=0A } catch (Exception e2) {=0A = e2.printStackTrace();=0A }=0A}=0A=0A=0A=0Aimport java.io.IOExcep= tion;=0Aimport javax.servlet.ServletException;=0Aimport javax.servlet.http.= HttpServletRequest;=0Aimport javax.servlet.http.HttpServletResponse;=0A=0A= =0Aimport org.mortbay.jetty.Handler;=0Aimport org.mortbay.jetty.Server;=0A= =0A=0Apublic class HTTPHandler implements Handler{=0A =0A public void= handle(String target, HttpServletRequest request, HttpServletResponse resp= onse, int dispatch) throws IOException, ServletException {=0A System= .out.println(request.toString());=0A }=0A =0A public void setServe= r(Server arg0) {=0A }=0A =0A public Server getServer() {=0A = return null;=0A }=0A =0A public void start() throws Exception {= =0A }=0A =0A public void stop() throws Exception {=0A }=0A = =0A public boolean isRunning() {=0A return false;=0A }=0A = =0A public boolean isStarted() {=0A return false;=0A }=0A = =0A public boolean isStarting() {=0A return false;=0A }=0A = =0A public boolean isStopping() {=0A return false;=0A }=0A = =0A public boolean isFailed() {=0A return false;=0A }=0A = =0A}=0A=0A=0AWhat do I do next. how do I actually handle the upload?=0A=0AT= hanks=0A=0A=0ASend instant messages to your online friends http://uk.messen= ger.yahoo.com |