change 'text/javascript' to 'application/json' in Java servlet example