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);  //视图添加内容
        	}
    	}
    

      

    -------------------------------------------------------------------------
    ## 极客时间全网最便宜最优惠购买方式,优惠券返现 百度网盘 微信关注公众号“选门好课”
    扫描下方二维码关注我的公众号"选门好课",与我一起交流知识
  • 相关阅读:
    3.消息队列和事件循环
    2.V8工作原理
    1.浏览器中的Javascript执行机制
    入前端之门半年的感想
    前端面试相关知识点整理记录
    Nginx报错——upstream timed out 10060
    浅谈偏向锁、轻量级锁、重量级锁
    Debug 的一点思路
    Shiro 之 HashedCredentialsMatcher 认证匹配
    计算机网络基础 之六:应用层
  • 原文地址:https://www.cnblogs.com/singworld/p/9821396.html
Copyright © 2011-2022 走看看