




已阅读5页,还剩4页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
网络应用系统设计知识点 2、ZUL页面怎么实现与控制器关联起来? apply=” 3、在页面上设置textbox的Value属性: 4、设置按钮可见:visible=true,按钮不可见visible=false 5、初始化方法doAfterCompose 6、zk常见组建: textbox、datebox、button、label、listbox、rows、 row、column 7、zk组件的常见属性:width,value,id ,format,type、 constraint 8、PostgreSQL是世界上最先进的开源数据库。 9、AJAX的定义 (1) AJAX 是“Asynchronous JavaScript and XML”(异步 JavaScript和XML),AJAX并非缩写词。 (2)由Jesse James Gaiiett创造的名词,是指一种创建交互式网页应用 的网页开发技术。 简答: 1、ZK是什么,ZK不是什么? (1)ZK 是一个事件驱动(event-driven)的,基于组件(component-based) 的,用以丰富网络程序中用户界面的框架。ZK 包括一个基于AJAX 事件 驱动的引擎(engine),一套丰富的XUL 和XHTML,以及一种被称为ZUML 的标记语言。 (2)ZK 并没有关注持久化(persistence)或伺服务器之间的沟通,它 只针对表示层,并不要求和暗示任何后端技术。 (3)Zk 并没有为开发人员提供(tunnel),RMI 或其他的API 用来在 客户端与服务器端通信。(4)ZK 并没有强迫开发人员使用MVC 或其 他设计模式。 (5)ZK 不是旨在把XUL 带入Web 应用的框架,它的目标是把桌面编 程模式引入Web应用。 2、MVC模式的含义: mvc 即 MVC框架 。MVC全名是Model View Controller,是模型(model) 视图(view)控制器(controller)的缩写。 3、JDK平台的搭建 (1) 新建变量JAVA_HOME,变量值填JDK安装的最终路径。 (2) 设置Path变量,先在末尾加上;再加入%JAVA_HOME%bin。 (3) 添加CLASSPATH变量,变量值为%JAVA_HOME%lib,点确定完成。 4、ZKoss开发环境搭建 答:1.首先下载jdk 7,正常安装后进行环境变量配置。 2.下载eclipse juno。解压后,直接运行。 3.安装Zkstudio,三种方法安装。 (1)从市场中安装(2)从更新源安装(3)离线安装 4.下载Tomcat7,解压。运行eclipse,完成服务器的安装。 5、服务器的安装、启动与关闭 安装:1、下载tomcat 7,解压。 2、运行eclipse ,选择WindowPreferences选择Server下面的 Runtime Environments,点击 “Add”按钮,进“New Server Runtime Environment”对话框,选择Apache 目录下我们要配置的Tomcat版本。 3、点击Tomcat installation directory右边的Browse按钮,进入本地磁盘 目录,选择Tomcat的安装目录,确定。 启动:双击tomcat7bin 目录下的startup.bat文件将服务器启动。 关闭:双击tomcat7bin 目录下的shutdown.bat文件将服务器关闭。 6、配置数据库连接池需要哪几个文件? web.xml用来初始化配置信息 context.xml配置数据源 postgresql-9.1-902.jdbc4驱动 DBConpool.java获取连接的公用类 注册页面 Listen(onClick = #submitUser) public void userRegister() if (!uPassword.getValue().equals(reTypePwd.getValue() Clients.showNotification(两次输入的密码不一致!, info, uPassword,end_center, 3000); return; if(this.isExist() return; Connection con = DBConPool.getConFromConPool(); PreparedStatement stmt=null; try stmt = con.prepareStatement(insert into users(uid,uname,upassword,uphoto) values(?,?,?,?); stmt.setString(1, uId.getValue(); stmt.setString(2, uName.getValue(); stmt.setString(3, uPassword.getValue(); stmt.setString(4, uphotoSrc); stmt.executeUpdate(); catch (SQLException e) / TODO Auto-generated catch block e.printStackTrace(); finally CloseCon.closeSC(stmt, con); Listen(onChange = #uId) public void checkUserId() if(this.isExist() throw new WrongValueException(uId,用户名已存在!); private boolean isExist() boolean isExist=false; Connection con = DBConPool.getConFromConPool(); PreparedStatement stmt=null; ResultSet rs=null; try stmt = con .prepareStatement(select * from users where uid=?); stmt.setString(1, uId.getValue(); rs=stmt.executeQuery(); if(rs.next() isExist=true; catch (SQLException e) / TODO Auto-generated catch block e.printStackTrace(); finally CloseCon.closeRSC(rs, stmt, con); return isExist; 登陆页面 Listen(onClick = #login) public void userLogin() if (!this.verifyCaptcah() return; Connection con = DBConPool.getConFromConPool(); PreparedStatement stmt = null; ResultSet rs = null; try stmt = con.prepareStatement(select * from users where uid=?); stmt.setString(1, uId.getValue(); rs = stmt.executeQuery(); if (!rs.next() Clients.showNotification(用户名不存在!, info, uId, end_center, 3000); else if (!rs.getString(upassword).trim() .equals(uPassword.getValue().trim() Clients.showNotification(密码输入错误!, info, uPassword, end_center, 3000); else Session sess = Sessions.getCurrent(); UserCredential cre = new UserCredential(); cre.setUid(rs.getString(uid).trim(); cre.setUname(rs.getString(uname).trim(); cre.setRoles(GetUserRoles.getRoles(uId.getValue(); sess.setAttribute(userCredential, cre); Executions.sendRedirect(/index.zul); catch (SQLException e) / TODO Auto-generated catch block e.printStackTrace(); 增删查改页面 Listen(onClick = #myBtn;onOK=#myTb) public void findStuInfo() List result = findStudents(myTb.getValue(); myLb.setModel(new ListModelList(result); private List findStudents(String searchKey) List resultList = new LinkedList(); Connection con = DBConPool.getConFromConPool(); PreparedStatement stmt; try stmt = con.prepareStatement(select * from students where stuid like ?,or stuname like ? ,or stusex like ?,or stucollege like ?,or stumajor like ? ); stmt.setString(1, % + searchKey + %); stmt.setString(2, % + searchKey + %); stmt.setString(3, % + searchKey + %); stmt.setString(4, % + searchKey + %); stmt.setString(5, % + searchKey + %); ResultSet rs = stmt.executeQuery(); while (rs.next() resultList.add(new Student(rs.getString(1), rs.getString(2),rs.getString(3),rs.getString(4),rs.getString(5); rs.close(); stmt.close(); con.close(); catch (SQLException e) / TODO Auto-generated catch block e.printStackTrace(); return resultList; Listen(onSelect = #myLb) public void BrowseStudent() editGrid.setVisible(true); modifyBtn.setVisible(true); addBtn.setVisible(false); Student selected = this.getSelectedStuInfo(); idTb.setValue(selected.getStuId(); nameTb.setValue(selected.getStuName(); sexTb.setValue(selected.getStuSex(); collegeTb.setValue(selected.getStuCollege(); majorTb.setValue(selected.getStuMajor(); private Student getSelectedStuInfo() Set selection = (Selectable) myLb.getModel().getSelection(); if (selection != null return selected; else return null; Listen(onClick = #modifyBtn) public void modifyStuInfo() Connection con = DBConPool.getConFromConPool(); PreparedStatement stmt; try stmt=con.prepareStatement(update students set stuname=?, stusex=?,stucollege=?,stumajor=?,where stuid=?); stmt.setString(1, nameTb.getValue(); stmt.setString(2, sexTb.getValue(); stmt.setString(3, collegeTb.getValue(); stmt.setString(4, majorTb.getValue(); stmt.setString(5, idTb.getValue(); stmt.executeUpdate(); this.findStuInfo(); Clients.showNotification(数据修改成功!, info, myLb, end_center,2000); stmt.close(); con.close(); editGrid.setVisible(false); catch (SQLException e) / TODO Auto-generated catch block e.printStackTrace(); Listen(onClick = #deleteBtn) public void deleteStuInfo() Student selected = this.getSelectedStuInfo(); Connection con = DBConPool.getConFromConPool(); PreparedStatement stmt; try stmt = con.prepareStatement(delete from students where stuid=? ); stmt.setString(1, selected.getStuId(); stmt.executeUpdate(); this.findStuInfo(); Clients.showNotification(数据删除成功!, info, myLb, end_center,2000); stmt.close(); con.close(); catch (SQLException e) / TODO Auto-generated catch block e.printStackTrace(); Listen(onClick = #insertBtn)新建 public void insertStuInfo() editGrid.setVisible(true); modifyBtn.setVisible(false); addBtn.setVisible(true); idTb.setValue(); nameTb.setValue(); sexTb.setValue(); collegeTb.setValue(); majorTb.setValue(); Listen(onClick = #addBtn)提交 public void addStuInfo() if(idTb.getValue().trim().equals()|idTb.getValue()=null) Clients.showNotification(数据不能为空!, info, addBtn, end_center,2000); return; Student selected = this.getSelectedStuInfo(); Connection con = DBConPool.getConFromConPool(); PreparedStatement stmt; try stmt =
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年影视行业报告:工业化制作流程与质量控制关键节点解析
- 节后复工培训课件
- 教师招聘之《小学教师招聘》能力测试备考题及参考答案详解
- 教师招聘之《小学教师招聘》通关试卷提供答案解析附答案详解(基础题)
- 教师招聘之《幼儿教师招聘》模拟题库讲解及答案详解【全优】
- 演出经纪人之《演出经纪实务》模拟考试高能及完整答案详解(夺冠)
- 教师招聘之《小学教师招聘》提分评估复习及答案详解(全优)
- 2025年教师招聘之《幼儿教师招聘》练习题库包(含答案详解)
- 2025年教师招聘之《幼儿教师招聘》模拟题库完整答案详解
- 2025年教师招聘之《幼儿教师招聘》考前冲刺练习题库附参考答案详解(典型题)
- 耳鼻喉科眼科门诊临床技术操作规范2022版
- 党章党纪党规知识竞赛案例分析30题(含答案)
- 火力发电厂节水导则DLT783-2023年
- 艾滋病梅毒丙肝检测与解释
- GB/T 22076-2008气动圆柱形快换接头插头连接尺寸、技术要求、应用指南和试验
- GB/T 12325-2008电能质量供电电压偏差
- CJJ28-2014城镇供热管网工程施工及验收规范
- 新《高等教育学》考试复习题库450题(含各题型)
- 三字经全文带拼音注释打印版
- 产品技术规格书模板
- 《绿色建筑评价标准》解读
评论
0/150
提交评论