use of io.clownfish.clownfish.datamodels.GetContentParameter in project Clownfish by rawdog71.
the class GetContentCountHibernate method doPost.
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
StringBuffer jb = new StringBuffer();
String line = null;
try {
BufferedReader reader = request.getReader();
while ((line = reader.readLine()) != null) {
jb.append(line);
}
} catch (Exception e) {
/*report an error*/
}
Gson gson = new Gson();
GetContentParameter gcp = gson.fromJson(jb.toString(), GetContentParameter.class);
processRequest(gcp, response);
String json = gson.toJson(gcp);
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json;charset=UTF-8");
PrintWriter out = response.getWriter();
out.println(json);
out.flush();
}
use of io.clownfish.clownfish.datamodels.GetContentParameter in project Clownfish by rawdog71.
the class GetContentHibernate method doPost.
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
StringBuffer jb = new StringBuffer();
String line = null;
try {
BufferedReader reader = request.getReader();
while ((line = reader.readLine()) != null) {
jb.append(line);
}
} catch (IOException e) {
/*report an error*/
}
Gson gson = new Gson();
GetContentParameter gcp = gson.fromJson(jb.toString(), GetContentParameter.class);
processRequest(gcp, response);
String json = gson.toJson(gcp);
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json;charset=UTF-8");
PrintWriter out = response.getWriter();
out.println(json);
out.flush();
}
use of io.clownfish.clownfish.datamodels.GetContentParameter in project Clownfish by rawdog71.
the class GetDatalist method doPost.
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
StringBuffer jb = new StringBuffer();
String line = null;
try {
BufferedReader reader = request.getReader();
while ((line = reader.readLine()) != null) {
jb.append(line);
}
} catch (IOException e) {
/*report an error*/
}
Gson gson = new Gson();
GetContentParameter gcp = gson.fromJson(jb.toString(), GetContentParameter.class);
if (null != gcp) {
processRequest(gcp, response);
}
String json = gson.toJson(gcp);
response.setContentType("application/json;charset=UTF-8");
response.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
out.println(json);
out.flush();
}
use of io.clownfish.clownfish.datamodels.GetContentParameter in project Clownfish by rawdog71.
the class GetDatalistHibernate method doPost.
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
StringBuffer jb = new StringBuffer();
String line = null;
try {
BufferedReader reader = request.getReader();
while ((line = reader.readLine()) != null) {
jb.append(line);
}
} catch (IOException e) {
/*report an error*/
}
Gson gson = new Gson();
GetContentParameter gcp = gson.fromJson(jb.toString(), GetContentParameter.class);
processRequest(gcp, response);
String json = gson.toJson(gcp);
response.setContentType("application/json;charset=UTF-8");
response.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
out.println(json);
out.flush();
}
use of io.clownfish.clownfish.datamodels.GetContentParameter in project Clownfish by rawdog71.
the class GetContent method doPost.
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
StringBuffer jb = new StringBuffer();
String line = null;
try {
BufferedReader reader = request.getReader();
while ((line = reader.readLine()) != null) {
jb.append(line);
}
} catch (Exception e) {
/*report an error*/
}
Gson gson = new Gson();
GetContentParameter gcp = gson.fromJson(jb.toString(), GetContentParameter.class);
processRequest(gcp, response);
String json = gson.toJson(gcp);
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json;charset=UTF-8");
PrintWriter out = response.getWriter();
out.println(json);
out.flush();
}
Aggregations