Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void processRequest(HttpServletRequest req, HttpServletResponse rep)
- throws ServletException, IOException {
- // rep.setContentType("application/json;charset=UTF-8");
- String cmd = req.getParameter("cmd");
- String path = "maintinfoAngularJS/WEB-INF/index.html";
- rep.setContentType("application/json;charset=UTF-8");
- BeanArticle a = new BeanArticle();
- Gson gson = new Gson();
- Type type = new TypeToken<List<Article>>() {}.getType();
- String json = gson.toJson(a.findArticle(), type);
- rep.setContentType("application/json");
- rep.getWriter().write(json);
Advertisement
Add Comment
Please, Sign In to add comment