So I'm trying to integrate wami-recorder into my webapp. The webapp currently is built using the Struts2 framework.
There is an example on StackOverflow here on how to integrate wami-recorder into a php site. How would I achieve similar functionality using Struts2? It seems like wami tries to POST the file to a certain URL. How do I get Struts2 to receive such a file? Or is there a better way to go about this?
EDIT: MMk so, I used Dave's wording to search google and found this. Right now, my action's execute method looks like
HttpServletRequest request = ServletActionContext.getRequest();
InputStream body = null;
try {
body = request.getInputStream();
OutputStream outputStream = new FileOutputStream("/home/test.mp3");
IOUtils.copy(body, outputStream);
outputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
return SUCCESS;'
However, when I use wami to POST
Wami.startRecording("http://localhost:8080/addRecording/test.wav");
I get the following in chrome developer tools:
Request URL:http://localhost:8080/addRecording/test.wav
Request Method:POST
Status Code:404 Not Found
Is there something wrong with the configuration of my action class? Or am I misusing wami?