}
public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch)
throws IOException, ServletException {
ObjectInputStream reqStream = new ObjectInputStream(request.getInputStream());
RemoteInvocation invocation;
try {
invocation = (RemoteInvocation) reqStream.readObject();
} catch (ClassNotFoundException e) {
throw new ServletException("Failed to load invocation class: " + e.getMessage(), e);
} finally {
reqStream.close();
}
System.out.println("Invocation: " + invocation + " - args=" + Arrays.toString(invocation.getArguments()));
assertEquals("Mismatched target value", "/" + invocation.getMethodName(), target);
String color = request.getHeader(Color.TOKEN_NAME);
assertFalse("No color provided", StringUtil.isEmpty(color));
RemoteInvocationResult result = new RemoteInvocationResult(invocation);