Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
// Here is a server side java applet which gets the file from the client. // The way it demonstrates it received the file from the client (meaning the file // upload was successful) it just spits out the file back to the browser. // Start of Server Side Java Applet code
public void run() throws Exception { Hashtable formdata; int x; PrintStream out = getOutputStream();
InputStream is = getInputStream(); DataInputStream di = new DataInputStream(is);
if (returnNormalResponse("text/html")) { out.print(header);
PrintStream POut = getOutputStream(); String line;
while ((line = di.readLine()) != null) POut.println(line); out.print(trailer); } } private static final String header = "<h1>Form results</h1>\n<ul>\n"; private static final String trailer = "</ul>\n"; }
// This is the HTML file calling the server side applet // What this HTML file does is allows a user to select a file which // can be uploaded to the server
I believe incrementing byte (byte b with increment operator (b++ does not convert it to int but by explicitly adding 1 to byte will convert it to int (b = b+1 .