- From: Mark I. Lubin <mil@physics.ucf.edu>
- Date: Sun, 7 Jul 1996 13:44:58 -0500
- To: abaird@w3.org
- Cc: www-jigsaw@w3.org
1) Your code ReverseString.java is working with the form <title>Test abckward</title> <h1>Testing reverse (PostableResource) !</h1> <form method="POST" action="http://cmt.physics.ucf.edu:9999/User/reverse"> <input type=text name=string> </form> As you see, I installed the resource *reverse* in User. Moreover, it works with following java code ReverseTest.java by invoking reverse as %java ReverseTest Jigsaw protocol = http host = cmt.physics.ucf.edu filename = /User/reverse port = 9999 ref = null reverse=[ wasgiJ] Obviously, one can orginize the applet interface with the code ReverseTest.java and that is what I really meant in my second part of the email. You described something more complicated. By the way, back to the ReverseString.java, I see that you got the string as String str = data.getValue("string"); Can you tell me, how can I get hold on more inputs form the Form ( in other words , say I have more complex Form : a few string-inputs, text-field, radio-buttons). That can be used for real-life example, like this survey about Jigsaw: <STRONG>Please take a minute and complete the form about Jigsaw</STRONG> <FORM METHOD="POST" ACTION="...."> Name: <INPUT NAME="name" SIZE=50><BR> Email Address: <INPUT NAME="email" SIZE=50><BR> <INPUT NAME="subject" TYPE="hidden" VALUE="COMMENTS"><P> Type whatever you wish about Jigsaw:<P> <TEXTAREA NAME="content" ROWS=10 COLS=60></TEXTAREA> </P><P> Do you like Jigsaw?<P> <INPUT TYPE="radio" NAME="the type" VALUE="Yes">Yes<BR> <INPUT TYPE="radio" NAME="the type" VALUE="No">No<BR> <INPUT TYPE="submit" VALUE="send via email"> <INPUT TYPE="reset" VALUE="clear form and start over"> <BR> </FORM> Then server will collect the information and send copy to the user. Best regards, Mark. P.S. ReverseTest.java: import java.io.*; import java.net.*; public class ReverseTest { public static void main(String args[]) { try { if (args.length != 1) { System.err.println("Usage: java ReverseTest string_to_reverse"); System.exit(1); } String stringToReverse = URLEncoder.encode(args[0]); URL url = new URL("http://cmt.physics.ucf.edu:9999/User/reverse"); System.out.println("protocol = " + url.getProtocol()); System.out.println("host = " + url.getHost()); System.out.println("filename = " + url.getFile()); System.out.println("port = " + url.getPort()); System.out.println("ref = " + url.getRef()); URLConnection connection = url.openConnection(); // writing to URL PrintStream outStream = new PrintStream(connection.getOutputStream()); DataInputStream inStream; String inputLine; outStream.println("string=" + stringToReverse); outStream.close(); // reading from URL inStream = new DataInputStream(connection.getInputStream()); while (null != (inputLine = inStream.readLine())) { System.out.println(inputLine); } inStream.close(); } catch (MalformedURLException me) { System.err.println("MalformedURLException: " + me); } catch (IOException ioe) { System.err.println("IOException: " + ioe); } } }
Received on Sunday, 7 July 1996 14:50:22 UTC