@RequestMapping(value = "jsonp.sir")
public void returnJsonp(HttpServletRequest request,HttpServletResponse response) throws IOException {
String username = request.getParameter("username");
String userpass = request.getParameter("userpass");
String callback = request.getParameter("callback");
Writer sw = new StringWriter();
ObjectMapper objectMapper = new ObjectMapper();
JsonGenerator jsonGenerator = objectMapper.getJsonFactory().createJsonGenerator(sw);
sw.write(callback + "(");
jsonGenerator.writeStartObject();
jsonGenerator.writeBooleanField("success", true);
jsonGenerator.writeStringField("username", username);
jsonGenerator.writeStringField("userpass", userpass);
jsonGenerator.writeEndObject();
jsonGenerator.flush();
sw.write(")");
sw.close();
Writer out =response.getWriter();
out.write(sw.toString());
}