I adapted an applet I found on the internet that allows users to record a voice message which is then saved on their local system as an audio file. I am now trying to change this so that the file is saved on the server instead. I have written a servlet (also adapted from an example I found on the internet) which is meant to get the audio data from the applet but nothing happens. The code compiles fine and I don't get any error messages.
I am new to Java and Tomcat and would appreciate any suggestions you might have to make this work. The code for both the applet and the servlet is pasted in below:
Joined: Jul 08, 2009
I'm starting to think the problem may lie with the way I have my files set up on Tomcat. I'm using version 6.0.20
The HTML file and applet (recorderV3.jar and recorderV3.html) are in webapps/ROOT/test/
The servlet (receiver.class) is in webapps/ROOT/test/WEB-INF/classes/
My web.xml file is in webapps/ROOT/test/WEB-INf and looks like this:
How do I put it in a package? Is that the same thing as a .jar file? And where does it go when it's in a package?
Sorry if these are basic questions. I have three textbooks and none of them explain anything about packages. Only one mentions deploying servlets and that just says to put the .class file inside WEB-INF/classes.
Ulf: thanks for pointing that out. Yes, http://localhost:8080/receiver does work if I access it directly - it makes a test.au file on the server. However, if I try to access it through the applet, nothing happens.
Joined: Mar 22, 2005
I'd advise to put a few strategically placed System.out.println statements in the applet's "run" method and the servlet's "doPost" method so you know they're being called. I take it there are no exceptions either on the client nor the server?
By the way, you should not use System.exit in applets; they're not going to work anyway.