- From: Chan Wing Luk <cscwl@cityu.edu.hk>
- Date: Wed, 15 Dec 1999 13:07:07 +0800
- To: www-jigsaw@w3.org
gentleman, below is my classpath info and Test.java when compile the file, it fails to reference jigsaw class files. can u show me how can i compile the file and generate valid request? or, can u send a sample code to me for reference? btw, do u know where should i start if i want to study/modify how's jigsaw proxy doing paging? becoz, i wanna write some resource & paging method for mobile environment. many thanks set classpath=.;..;c:\java\jdk1.2.1\src.jar set classpath=%classpath%;c:\java\jsdk2.1\server.jar set classpath=%classpath%;c:\java\jsdk2.1\servlet.jar set classpath=%classpath%;e:\Jigsaw\classes\jigsaw.zip;e:\Jigsaw\classes\jigadmi n.jar;e:\Jigsaw\classes\sax.jar;e:\Jigsaw\classes\xp.jar package src/classes/org/w3c/jigsaw/test import java.util.*; import java.net.*; import java.io.*; // FIXME - DEBUG import org.w3c.www.mime.*; import org.w3c.util.*; public static void main(String args[]) { try { // Get the manager, and define some global headers: HttpManager manager = HttpManager.getManager(); manager.setGlobalHeader("User-Agent", "Jigsaw/1.0a"); manager.setGlobalHeader("Accept", "*/*;q=1.0"); manager.setGlobalHeader("Accept-Encoding", "gzip"); PropRequestFilter filter = new org.w3c.www.protocol.http.cookies.CookieFilter(); filter.initialize(manager); PropRequestFilter pdebug = new org.w3c.www.protocol.http.DebugFilter(); pdebug.initialize(manager); Request request = manager.createRequest(); request.setURL(new URL(args[0])); request.setMethod("GET"); Reply reply = manager.runRequest(request); //Display some infos: System.out.println("last-modified: "+reply.getLastModified()); System.out.println("length : "+reply.getContentLength()); // Display the returned body: InputStream in = reply.getInputStream(); byte buf[] = new byte[4096]; int cnt = 0; while ((cnt = in.read(buf)) > 0) System.out.print(new String(buf, 0, 0, cnt)); System.out.println("-"); in.close(); manager.sync(); } catch (Exception ex) { ex.printStackTrace(); } System.exit(1); } } regards, Julian Minci
Received on Wednesday, 15 December 1999 00:03:41 UTC