W3C home > Mailing lists > Public > www-jigsaw@w3.org > July to August 1996

Re: An example for PostableResource wanted

From: Mark I. Lubin <mil@physics.ucf.edu>
Date: Sun, 7 Jul 1996 13:44:58 -0500
Message-Id: <9607071844.AA23553@phys>
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>

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

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
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

<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>

Then server will collect the information and send copy to the user.

Best regards,

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");
                           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);

// reading from URL
                           inStream = new DataInputStream(connection.getInputStream());
                           while (null != (inputLine = inStream.readLine())) {
                       } 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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:29 UTC