// Reconstruct original requesting URL
String url = scheme + "://" + serverName + ":" + serverPort + contextPath;
response.setHeader("location", url + "/session/" + session);
}
BeanToJsonConverter converter = new BeanToJsonConverter();
String s = converter.convert(resp);
// status is also used for debugging, it's worth formatting it nice.
if (req.getGenericCommand() == WebDriverLikeCommand.STATUS) {
JSONObject o = new JSONObject(s);
response.getWriter().print(o.toString(2));