刘德华搞研发1的gravatar头像
刘德华搞研发1 2016-01-19 17:36:17

spring mvc项目源码实例代码哪位一行一行解释一下?

package com.mossle.ssdc.web;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import java.util.Map;
import java.util.ArrayList;
import com.mossle.core.page.Page;
import com.mossle.ssdc.support.DCWJ;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import com.mossle.core.export.TableModel;
import com.mossle.ssdc.service.DCWJService;
import com.mossle.core.export.Exportor;
import com.mossle.core.mapper.BeanMapper;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import javax.servlet.http.HttpServletRequest;
import com.mossle.core.spring.MessageHelper;
import javax.servlet.http.HttpServletResponse;
import com.mossle.core.hibernate.PropertyFilter;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import com.mossle.ssdc.persistence.manager.DCWJManager;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

@Controller
@RequestMapping("/ssdc")
public class DCWJController extends HttpServlet{
   
    private DCWJ dcwjVo;
    private DCWJService dcwjservice;
    private ArrayList<DCWJ> dcwjlist;
    private String dcwjid;
    private String a;
    private String b;
    private Exportor exportor;
    private BeanMapper beanMapper = new BeanMapper();
    private MessageHelper messageHelper;
    private DCWJManager dcwjdao;

 //显示所有问卷
    @RequestMapping("dcwj-showwj-list")
    public String showwj(@ModelAttribute Page page,
            @RequestParam Map<String, Object> parameterMap, Model model){
        List<PropertyFilter> propertyFilters = PropertyFilter.buildFromMap(parameterMap);
        page=dcwjdao.pagedQuery(page, propertyFilters);
        model.addAttribute("page", page);
     return "ssdc/dcwj-showwj-list";   
    }

  public DCWJ getDcwjVo() {
        return dcwjVo;
    }
    @Autowired(required = false)
    public void setDcwjVo(DCWJ dcwjVo) {
        this.dcwjVo = dcwjVo;
    }

    public DCWJService getDcwjservice() {
        return dcwjservice;
    }
    @Resource
    public void setDcwjservice(DCWJService dcwjservice) {
        this.dcwjservice = dcwjservice;
    }


    public ArrayList<DCWJ> getDcwjlist() {
        return dcwjlist;
    }

    @Autowired(required = false)
    public void setDcwjlist(ArrayList<DCWJ> dcwjlist) {
        this.dcwjlist = dcwjlist;
    }


    public String getDcwjid() {
        return dcwjid;
    }

    @Autowired(required = false)
    public void setDcwjid(String dcwjid) {
        this.dcwjid = dcwjid;
    }

    public String getA() {
        return a;
    }
    @Autowired(required = false)
    public void setA(String a) {
        this.a = a;
    }

    public String getB() {
        return b;
    }
    @Autowired(required = false)
    public void setB(String b) {
        this.b = b;
    }
   
    @Resource
    public void setExportor(Exportor exportor) {
        this.exportor = exportor;
    }

    @Resource
    public void setMessageHelper(MessageHelper messageHelper) {
        this.messageHelper = messageHelper;
    }

    }

其实就是想访问一下数据库,把东西取出来

所有回答列表(2)
Raikiri的gravatar头像
Raikiri  LV3 2016年1月23日

这只是整个项目的一个文件,最好全部都发上来。

还有,要是你一点都不会就算一行一行给你讲你也是听不懂的。

咕噜流氓兔的gravatar头像
咕噜流氓兔  LV5 2016年1月25日

楼上正解

顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友