EXT-DWR-SPRING 整合详细指导

目标:将ext2.2和dwr3和spring整合起来.在界面上显示

gtalk:[email protected]
web:http://www.jiqishu.com

流程:
1.创建数据库在mysql,用abator 生成数据库关系映射
2.配好dwr,写好javabean.
3.整合spring.
4.配置ext,写ext界面代码.
5.调试通过.

准备工作:
       mysql的可视化工具,mysql5自己准备.


详细方法:
1.在mysql中创建dinosaur数据库,建表Department.

sql语句:
   CREATE TABLE department (
  DeptCode varchar(20) NOT NULL,
  DeptName varchar(20) default NULL,
  FatherCode varchar(20) default NULL,
  DeptType varchar(20) default NULL,
  DeptDesc varchar(20) default NULL,
  PRIMARY KEY  (DeptCode)
) ;


2.abator连接并映射:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE abatorConfiguration PUBLIC "-//Apache Software Foundation//DTD Abator for iBATIS Configuration 1.0//EN"
  "http://ibatis.apache.org/dtd/abator-config_1_0.dtd">

<abatorConfiguration>
    <abatorContext generatorSet="Java5"><!-- TODO: Add Database Connection Information -->
    <jdbcConnection driverClass="com.mysql.jdbc.Driver"
        connectionURL="jdbc:mysql://172.16.66.205:3306/dinosaur?characterEncoding=UTF8"
        userId="root"
        password="12345">
      <classPathEntry location="C:\Users\arpenker\workspace\extDwrSpring\WebRoot\WEB-INF\lib\mysql-connector-5.1.3.jar" />
    </jdbcConnection>

    <javaModelGenerator targetPackage="com.dinosaur.ibatis" targetProject="extDwrSpring" />
    <sqlMapGenerator targetPackage="com.dinosaur.ibatis" targetProject="extDwrSpring" />
    <daoGenerator type="spring" targetPackage="com.dinosaur.ibatis" targetProject="extDwrSpring" />

    <table schema="First" tableName="Department">
      <!--  columnOverride column="???" property="???" / -->
    </table>

  </abatorContext>
</abatorConfiguration>


3.index.jsp

<%@ page contentType="text/html;charset=UTF-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>EXT-DWR-SPRING精讲</title>

<link rel="stylesheet" type="text/css" href="ext-2.2.1/resources/css/ext-all.css" />
<script type="text/javascript" src="ext-2.2.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext-2.2.1/ext-all.js"></script>

    
        
  <script type='text/javascript' src='/extDwrSpring/dwr/interface/DepartmentService.js'></script>
  <script type='text/javascript' src='/extDwrSpring/dwr/engine.js'></script>    
  
   <script type='text/javascript' src='/extDwrSpring/dwr/util.js'></script>
    <script type="text/javascript" src="ext-2.2.1/dwrproxy.js"></script>
    
     <script type="text/javascript" src="Department.js"></script>
  
</head>

    <style type="text/css">
        body .x-panel {
            margin-bottom:20px;
        }
        .icon-grid {
            background-image:url(/shared/icons/fam/plugin.gif) !important;
        }
        #button-grid .x-panel-body {
            border:1px solid #99bbe8;
            border-top:0 none;
        }
        .add {
            background-image:url(/shared/icons/fam/add.gif) !important;
        }
        .refresh {
            background-image:url(/shared/icons/fam/table_refresh.png) !important;
        }
        .remove {
            background-image:url(/shared/icons/fam/delete.gif) !important;
        }
        .save {
            background-image:url(/shared/icons/save.gif) !important;
        }    
    </style>
    
<body>
dwr-ext-spring
<br/>

<select name="deptselect" id="deptselect" style="display: none;">
<option value="用户名">用户名</option>
<option value="密码">密码</option>
<option value="城市">城市</option>
</select>

<div id="department"></div>

</body>
</html>



看附件吧..代码太多了.
qq group: 5069015


全部源文件由于太大.上传不了.可以和我取得联系.邮件给你.

你可能感兴趣的:(spring,mysql,ibatis,ext,DWR)