欢迎来到天天文库
浏览记录
ID:40570426
大小:50.50 KB
页数:4页
时间:2019-08-04
《spring mvc框架流程》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、1.JSP页面上有个按钮被按按钮ID为customInfoChangeHistory写一个如下JS(按钮单击事件)//客户信息更改历史$('#customInfoChangeHistory').click(function(){varurlStr=new$.Template("${contextPath}");varurlParam={customerId:customer_id,taskId:taskId
2、};varCustomInfoChangeHistory=urlStr.expand(urlParam);window.open(CustomInfoChangeHistory);});其中$.Template("${contextPath}");调用名字为CUSTOMER_INFO_HISTORY_INDEX的Controller是一个JAVA类。varurlParam={customerId:custo
3、mer_id,taskId:taskId};是传入到Controller的值.2.Controller如下/***
Title:queryCustomerHistory
Description:查询客户历史记录
4、ariablefinallongcustomerId,@PathVariablefinallongtaskId,finalModelMapmap){map.addAttribute("customerId",customerId);map.addAttribute("taskId",taskId);returnViews.MAIN_CUSTOMER_HISTORY_VIEW;}Url.CUSTOMER_INFO_HISTORY_INDEX与上面名字同3.该Controller会调用相应的SERVICESSERVICES如下:/***
Title:getGrou
5、pAndCampaignStatus
Description:根据任务ID获取组别和活动状态
6、Status(longtaskId){returncustomerInfoDAO.selectByGroupAndCampaignStatus(taskId);}Services中如果需要调用数据库会调用DAO4.DAO使用如下/***
Title:selectByGroupAndCampaignStatus
Description:根据TaskId判断返回Task是否可执行状态
7、essWarnings("unchecked")publicMapselectByGroupAndCampaignStatus(longtaskId){return(Map)getSqlMapClientTemplate().queryForObject("CUSTOMER_INBOUND.getGroupAndCampaignStatus",taskId);}其中getSqlMapClientTemplate().queryForObject("CUSTOMER_INBOUND.getG
8、roupA
此文档下载收益归作者所有