jsp页面的教程
文件大小: 1937k
源码售价: 10 个金币 积分规则     积分充值
资源说明:第1 章JSP 简介................................................................................10 1.1 什么是JSP........................................10 1.2 JSP 页面..........................................10 1.3 JSP 的运行原理....................................12 1.4 安装配置JSP 运行环境.............................16 1.5 JSP 页面的测试...................................20 1.6 JSP 与Java Servlet 的关系........................23 第2 章JSP 语法.................................................................................25 2.1 JSP 页面的基本结构................................25 2.2 变量和方法的声明.................................29 2.2.1 声明变量 .......................................................................29 2.2.2 声明方法 .......................................................................32 2.2.3 声明类...........................................................................37 2.3 Java 程序片......................................40 2.4 表达式...........................................45 2.5 JSP 中的注释......................................46 2.6 JSP 指令标签.....................................49 2.6.1 page 指令......................................................................49 II 2.6.2 include 指令标签........................................................54 2.7 JSP 动作标签.....................................59 2.7.1 include 动作标签........................................................59 2.7.2 param 动作标签.............................................................64 2.7.3 forward 动作标签........................................................65 2.7.4 plugin 动作标签..........................................................69 2.7.5 useBean 动作标签........................................................75 第3 章JSP 内置对象........................................................................76 3.1 request 对象.....................................77 3.1.1 获取客户提交的信息....................................................78 3.1.2 处理汉字信息................................................................83 3.1.3 常用方法举例................................................................85 3.1.4 用户注册 .......................................................................93 3.1.5 获取 HTML 表单提交的数据........................................101 3.1.6 表格.............................................................................112 3.2 response 对象...................................116 3.2.1 动态响应 contentType 属性......................................116 3.2.2 response 的HTTP 文件头...........................................122 3.2.3 response 重定向.........................................................124 III 3.2.4 response 的状态行.....................................................125 3.3 session 对象.....................................132 3.3.1 session 对象的Id......................................................132 3.3.2 session 对象与URL 重写...........................................135 3.3.3 session 对象的常用方法: .......................................140 3.3.4 计数器.........................................................................150 3.4 application 对象.................................153 3.4.1 application 对象的常用方法..................................153 3.4.2 用 application 制作留言板......................................155 3.5 out 对象........................................160 第4 章JSP 中的文件操作...............................................................166 4.1 File 类.........................................166 4.1.1 获取文件的属性..........................................................166 4.1.2 创建目录 .....................................................................169 4.1.3 删除文件和目录..........................................................174 4.2 使用字节流读写文件..............................175 4.2.1 FileInputStream 和FileOutputStream 类.............177 4.2.2 BufferedInputStream 和BufferedOutputStream 类179 4.3 使用字符流读写文件..............................183 IV 4.3.1 FileReader 和FileWriter 类..................................184 4.3.2 BufferedReader 和BufferedWriter 类....................185 4.4 回压字符流......................................193 4.5 数据流..........................................196 4.6 对象流..........................................204 4.7 RandomAccessFile 类..............................214 4.8 文件上传........................................223 4.9 文件下载........................................232 4.10 分页读取文件....................................235 4.11 标准化考试......................................240 第5 章JSP 中使用数据库...............................................................251 5.1 数据源..........................................251 5.2 JDBC-ODBC 桥接器.................................258 5.3 查询记录........................................259 5.3.1 顺序查询.....................................................................262 5.3.2 游动查询.....................................................................266 5.3.3 随机查询 .....................................................................271 5.3.4 参数查询.....................................................................275 5.3.5 排序查询.....................................................................282 V 5.3.6 分析结果集查询..........................................................286 5.3.7 使用统配符查询..........................................................289 5.4 更新记录........................................290 5.5 添加记录........................................297 5.6 删除记录........................................305 5.7 分页显示记录....................................311 5.8 连接数据库的其它方式............................315 5.8.1 连接 Oracle 数据库....................................................315 5.8.2 连接 MySql 数据库......................................................318 5.9 查询Excel 电子表格..............................319 5.10 使用同步连接....................................323 5.11 网上投票........................................327 5.12 成绩录入查询系统................................336 第6 章JSP 与JavaBeans ................................................................362 6.1 编写javabeans 和使用javabeans...................363 6.1.1 编写beans...................................................................363 6.1.2 使用beans...................................................................364 6.2 beans 的存放目录.................................372 6.3 获取和修改beans 的属性..........................376 VI 6.3.1 getProperty 动作标签...............................................376 6.3.2 setProperty 动作标签...............................................379 6.4 beans 的辅助类...................................389 6.5 带包名的beans...................................393 6.6 JSP 与beans 结合的简单例子.......................397 6.6.1 三角形 beans...............................................................397 6.6.2 计数器 beans...............................................................400 6.6.3 购物车 beans...............................................................402 6.6.4 读文件 beans..............................................................412 6.6.5 写文件 beans...............................................................420 6.6.6 查询数据库beans.......................................................428 6.6.7 猜数字beans...............................................................432 6.6.8 标准化考试 beans......................................................437 6.6.9 日期 beans..................................................................446 6.6.10 分页显示记录beans ..................................................450 第7 章基于会员制的网络交友.......................................................461 7.1 系统设计.......................................461 7.2 数据库设计及连接................................462 7.3 页面管理........................................464 VII 7.4 各个页面的设计..................................466 7.4.1 会员注册.....................................................................467 7.4.2 会员登录.....................................................................479 7.4.3 浏览会员 .....................................................................486 7.4.4 查找会员 .....................................................................495 7.4.5 留言板.........................................................................502 7.4.6 查看公共留言..............................................................514 7.4.7 查看私人留言..............................................................521 7.4.8 修改密码 .....................................................................532 7.4.9 修改个人信息..............................................................537 第8 章网上书店..............................................................................543 8.1 系统设计.......................................543 8.2 数据库设计及连接................................544 8.3 页面管理........................................546 8.4 各个页面的设计..................................547 8.4.1 用户注册 .....................................................................548 8.4.2 用户登录.....................................................................557 8.4.3 用户订购.....................................................................565 8.4.4 查看订单.....................................................................578 VIII 8.4.5 修改订单.....................................................................581 8.4.6 浏览书目.....................................................................591 8.4.7 修改密码 .....................................................................601 8.4.8 修改个人信息..............................................................606 第9 章Java Servlet ....................................................................612 9.1 S ERVLET工作原理..................................612 9.1.1 Servlet 的生命周期..................................................612 9.1.2 init 方法:.................................................................613 9.1.3 service 方法...............................................................614 9.1.4 destroy 方法...............................................................614 9.2 编译和安装SERVLET ................................615 9.2.1 简单的servlet 例子..................................................615 9.2.2 编译servlet...............................................................616 9.2.3 存放 servlet 的目录..................................................617 9.2.4 运行 servlet...............................................................618 9.2.5 带包名的servlet.......................................................620 9.3 通过JSP 页面调用SERVLET ..........................621 9.3.1 通过表单向servlet 提交数据..................................621 9.3.2 通过超链接访问servlet ...........................................624 IX 9.4 SERVLET的共享变量................................625 9.5 H TTPSERVLET 类 ....................................629 9.5.1 doGet 方法和doPost 方法.........................................629 9.5.2 处理 HTTP 请求头及表单信息....................................637 9.5.3 设置响应的HTTP 头....................................................646 9.6 用SERVLET读写文件................................651 9.6.1 读取文件的内容..........................................................652 9.6.2 写文件.........................................................................659 9.7 用SERVLET访问数据库..............................663 9.7.1 数据库记录查询..........................................................664 9.7.2 使用共享连接..............................................................672 9.8 会话管理........................................676 9.8.1 获取用户的会话..........................................................676 9.8.2 购物车.........................................................................680 9.8.3 猜数字.........................................................................687
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。