src/com/pure/web/spring/OnlineController.java

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package com.pure.web.spring;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import com.pure.domain.MemberDish;
import com.pure.domain.logic.DishFacade;
import com.pure.domain.logic.DishSortFacade;
import com.pure.page.Page;
import com.pure.page.PageHelper;
import com.pure.sys.Constant;
import com.pure.util.ParamUtil;
import java.util.List;

public class OnlineController implements Controller {
	protected final Log logger = LogFactory.getLog(getClass());

	private DishSortFacade dishSortFacade;

	private DishFacade dishFacade;
	
	private String successView;

	public ModelAndView handleRequest(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		dishSortList(request);
		dishList(request);
		return new ModelAndView(this.getSuccessView());
	}

	private void dishSortList(HttpServletRequest request) {
		request.setAttribute("dishSortList", this.getDishSortFacade().getDishSortList());
	}

	private void dishList(HttpServletRequest request) {
		HttpSession session = request.getSession();
		String contextPath = request.getContextPath();
		String totalHql = "select count(id) from Dish";
		String hql = " from Dish as dish left join fetch dish.dishsort order by dish.id desc";
		String realPath = session.getServletContext().getRealPath("/");
		String templatePath = Constant.TEMPLATEPATH;
		String templateName = "dishList.ftl";
		String url = "/online.jspx";

		int perPage = 10;
		int cPage = ParamUtil.getInt(request, "page", 1);
		int total = this.getDishFacade().getTotal(totalHql);

		PageHelper pageHelper = new PageHelper(request);
		perPage = pageHelper.doCustomPerPage(perPage);

		Page page = new Page();
		page.setPerPage(perPage);
		cPage = pageHelper.getCpage(total, perPage, cPage);
后面还有 45 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。