The following excercise uses a java program as a form-data parser. To parse the data POSTed to it, the .java program uses both conditions (if) and loops (while).

  • Here's a text area that accomplishes what was set out in the assignment for Monday. It takes a text area, filters out the +'s and %XX numbers, translating them to their appropriate values. Once again, an "invoker script is used that sends the QUERY_STRING to the parser3.class.

    This invoker is not necessary if you make the class file executeable--the Linux system has been configured to recognize .class files. (<FORM METHOD=POST ACTION="my.class">)


  • Source for the java parser.
  • Source for the (optional) script.

    Type some stuff:


    This form sends its input, arg1, to the j3_invoker.cgi script, or directly to the parser3.class, if you choose. Using the POST method.
    	http://server.com/java/j3_invoker.cgi
    
    So, the cgi script receives its data as "standard input" and sends it to the java program (or if you made the program itself executeable and named it in the form's "action" attribute, it sends the data directly to the .class file as its standard input), parser3.java, which strips away the special characters.