You can override public boolean preProcess(HttpExchange exchange)
in your implementation of RemoteServiceServlet as follow.
public boolean preProcess(HttpExchange exchange) {
String body = null;
RPCRequest req = null;
// Read and parse the request
byte[] bytes = null;
Object bytebuf = getAttribute("RequestBody");
if ((bytebuf != null) && (bytebuf instanceof ByteBuffer)) {
bytes = ((ByteBuffer) bytebuf).array();
}
if (bytes == null) {
setAttribute("ResponseCode", new Integer(500));
setAttribute("ResponseBody", "Missing Request Body.");
return true;
}
body = new String(bytes, "UTF-8");
req = RPC.decodeRequest(body, this.getClass());
String methodName = req.getMethod().toString();
//Here you have name of a method
//You can get parameters
//Object[] parms = req.getParameters();
return true;
}