spritdance 发表于 2016-2-5 19:22:27

关于代码自动生成的问题

请教:
按照“招聘管理系统”的视频学习,在自动代码生成部分,出现了问题,请教。先把过程重现下:
1.新增自定义按钮。
2.利用jeecg的代码生成工具,生成代码
3.修改配置文件:
spring-mvc.xml
    <!-- 加载controller的时候,不加载service,因为此时事物并未生效,若此时加载了service,那么事物无法对service进行拦截 -->
    <context:component-scan base-package="org.jeecgframework.web.*,zpsystem.*">
      <context:exclude-filter type="annotation"
            expression="org.springframework.stereotype.Service" />
    </context:component-scan>

spring-mvc-hibernate.xml
<!-- 自动扫描dao和service包(自动注入) -->
    <context:component-scan base-package="org.jeecgframework.core.common.dao.*" />
    <context:component-scan base-package="org.jeecgframework.core.common.service.*" />
    <context:component-scan base-package="zpsystem.*" />

    <!-- 加载service,此时要排除要controller,因为controller已经spring-mvc中加载过了 -->
    <context:component-scan base-package="org.jeecgframework.web.*,zpsystem.*">
      <context:exclude-filter type="annotation"
            expression="org.springframework.stereotype.Controller" />
    </context:component-scan>

<!-- 注解方式配置 -->
      <property name="packagesToScan">
            <list>
                <value>org.jeecgframework.web.system.pojo.*</value>
                <value>org.jeecgframework.web.demo.entity.*</value>
                <value>org.jeecgframework.web.test.entity.*</value>
                <value>org.jeecgframework.web.cgform.entity.*</value>
                <value>org.jeecgframework.web.cgreport.entity.*</value>
                <value>org.jeecgframework.web.rank.*</value>
                <value>org.jeecgframework.web.sms.*</value>
                <value>zpsystem.*</value>
            </list>
      </property>

4.编写js增强代码:
function jishu(){
    var rowsData = getzp_gradeListSelected('id');
            if (!rowsData || rowsData.length==0) {
                tip('请选择一条简历进行技术面试!');
                return;
            }
            if (rowsData.length>1) {
                tip('请最多选择一条简历进行技术面试!');
                return;
            }
            url = 'zpGradeController.do?addorupdate_js&id='+rowsData;
            $.dialog({
                content: "url:"+url,
                lock : true,
                title: '技术面试评分",
                opacity : 0.3,
                width:500,
                height:300,
                cache:false,
                ok: function(){
                  iframe = this.iframe.contentWindow;
                  saveObj();
                  return false;
                },
                cancelVal: '<t:mutiLang langKey="common.close"/>',
                cancel: true /*为true等价于function(){}*/
            });
}

5.刷新页面:

原来的记录无法显示,调试了js代码,页面list中选中的记录id能取到,怀疑这段代码有问题:url = 'zpGradeController.do?addorupdate_js&id='+rowsData;
是不是spring的配置文件的问题?请高手指教。谢谢。

spritdance 发表于 2016-2-8 10:24:54

自己找到错误了,
title: '技术面试评分",
这里的单引号搞错了:)
页: [1]
查看完整版本: 关于代码自动生成的问题