zoukankan      html  css  js  c++  java
  • model流程

    	@RequestMapping("toDetail.do")
        public ModelAndView toDetail(HttpServletRequest request,HttpServletResponse response, ModelMap modelMap) {	
        	FormSource source = this.source(request); 
        	SFObject mainEntity = this.createMainEntity();
        	ModuleService service = this.createService();
        	
        	try{   		    		
            	this.toDetail_bind(request,modelMap,source,mainEntity,service);
            	source.put(modelMap);      //表单提交视图
          	
        	}catch(Exception e ){
        		this.logger.error(e);
        	}
        	
        	return this.output(response, modelMap);
        }
    
    
    protected void toDetail_bind(HttpServletRequest request, ModelMap modelMap,FormSource source, SFObject mainEntity, ModuleService service) throws Exception  {
    		ARTICLEINFO bean = this.bean(request, ARTICLEINFO.class,false);
        	List<ARTICLEINFO> list = service.beans(bean);
            
        	if(list.size()>0){
        		bean =list.get(0);
        		
        		if(bean.getISOUTLINK().equals(CommonType.NO)){
        			String VISITADDR = WechatArgument.getBACKGROUND() + "/" + bean.getVISITADDR();
        			bean.setVISITADDR(VISITADDR);
        		}
        		
        		String PICADDR = WechatArgument.getBACKGROUND() + bean.getPICADDR();
        		String PICADDRBRI = WechatArgument.getBACKGROUND() + bean.getPICADDRBRI();
        		
        		bean.setPICADDR(PICADDR);
        		bean.setPICADDRBRI(PICADDRBRI);
        		
        		modelMap.put("bean",bean);  //视图添加内容
        	}
    	}
    

      

    -------------------------------------------------------------------------
    ## 极客时间全网最便宜最优惠购买方式,优惠券返现 百度网盘 微信关注公众号“选门好课”
    扫描下方二维码关注我的公众号"选门好课",与我一起交流知识
  • 相关阅读:
    mybatis
    spring mvc
    Spring Boot2
    Spring AOP
    Spring Boot1
    Spring IOC
    Multiple_LinearRegression_Test2
    Multiple_LinearRegression_Test
    Simple_LinearRegression_Test
    写决策树时遇到的坑
  • 原文地址:https://www.cnblogs.com/singworld/p/9821396.html
Copyright © 2011-2022 走看看