You can use annotations to map request method on a restful function according to the Javax RS Api. So it depends of which Restful Java Api you use.
An example from the oracle documentation:
package com.sun.jersey.samples.helloworld.resources;
import javax.ws.rs.GET;
import javax.ws.rs.Produces;
import javax.ws.rs.Path;
// The Java class will be hosted at the URI path "/helloworld"
@Path("/helloworld")
public class HelloWorldResource {
// The Java method will process HTTP POST requests
@POST
// The Java method will produce content identified by the MIME Media
// type "text/plain"
@Produces("text/plain")
public String getClichedMessage() {
// Return some cliched textual content
return "Hello World";
}
}
The Javascript :
$('#fileupload').fileupload({
url: 'http://yourSite/helloworld',
type: 'POST',
...