标签:android blog http io os ar java sp div
该Servlet是一个前端控制器,他会调用Spring容器中业务逻辑组件的方法,通过该方法获取系统中的拍卖物品:
@WebServlet(urlPatterns="/android/viewFail.jsp") public class ViewFailServlet extends BaseServlet { public void service(HttpServletRequest request , HttpServletResponse response) throws IOException , ServletException { // 获取业务逻辑组件 AuctionManager auctionManager = (AuctionManager)getCtx().getBean("mgr"); // 获取系统内所有流拍的物品 List<ItemBean> items = auctionManager.getFailItems(); JSONArray jsonArr= new JSONArray(items); response.setContentType("text/html; charset=GBK"); response.getWriter().println(jsonArr.toString()); } }
标签:android blog http io os ar java sp div
原文地址:http://www.cnblogs.com/zhujiabin/p/3998997.html