CN103530103A - 一种在线教育网站的设计方法 - Google Patents

一种在线教育网站的设计方法 Download PDF

Info

Publication number
CN103530103A
CN103530103A CN201210494673.8A CN201210494673A CN103530103A CN 103530103 A CN103530103 A CN 103530103A CN 201210494673 A CN201210494673 A CN 201210494673A CN 103530103 A CN103530103 A CN 103530103A
Authority
CN
China
Prior art keywords
jsp
tiles
framework
website
page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201210494673.8A
Other languages
English (en)
Inventor
胡跃波
周会强
刘安辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
LUOYANG HENGKAI INFORMATION TECHNOLOGY Co Ltd
Original Assignee
LUOYANG HENGKAI INFORMATION TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by LUOYANG HENGKAI INFORMATION TECHNOLOGY Co Ltd filed Critical LUOYANG HENGKAI INFORMATION TECHNOLOGY Co Ltd
Priority to CN201210494673.8A priority Critical patent/CN103530103A/zh
Publication of CN103530103A publication Critical patent/CN103530103A/zh
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

本发明公开了一种在线教育网站的设计方法,利用Struts的Tiles框架,建立起来的网站的三部分页面的基本框架,Tiles-defs.xml是Struts的Tiles框架配置文件,主要功能是定义了Tiles框架中的Jsp页面在框架的什么位置,并把value所表示的JSP页面插入到指定的JSP框架页面中。导航页面部分(menu.jsp)、内容显示页面部分(content.jsp)、页尾部分(footer.jsp)。具有节省了设计人员在设计网站整体框架时的时间,而且思路清晰,结构简单,减少了很多冗余代码的特点。

Description

一种在线教育网站的设计方法
技术领域
本发明涉及网站设计领域,尤其是一种基于Struts 框架结构的在线教育网站的设计方法。
背景技术
21 世纪以来,远程教育这个词在人们的生活中经常出现。各个国家都积极利用发展现代远程教育来推动本国教育的发展。我国教育部拟订的《面向21 世纪教育振兴行动计划》中也提出“形成开放式教育网络,构建终身学习体系”。网络上不同的教育网站相当于有着不同教育目标的学校,担负着教书育人的任务。
J2EE,Java2平台企业版(Java 2 Platform Enterprise Edition),是Sun公司为企业级应用推出的标准软件系统开发平台。而随着Java技术的发展,J2EE平台得到了迅速的发展,成为Java语言中最活跃的体系之一。现如今,J2EE不仅仅是指一种标准平台(Platform),她更多的表达着一种软件系统架构和软件系统编程方法。
J2EE企业级Web应用开发系统框架有Struts、Webwork、JSF、Tapestry等开发框架。
 其中,Struts系统框架是开放源代码的企业级Web应用开发系统框架,目的是从整体上减轻构造企业Web应用的负担。而J2EE的表示层一般是用Struts组件系统框架来编写,其是目前最常用的企业级Web应用开发系统框架。
 Struts系统框架是基于Model 2设计模式的J2EE应用开发平台。Model 2体系是MVC (Model-View-Controller)体系中的一种。在MVC体系中,数据模型(Model)、表现逻辑(View)和控制逻辑(Controller)是分离的组件,但它们可以互相通信,Struts系统框架正是定位在基于Model 2设计模式的J2EE应用开发系统框架。
 但是,相比于其它J2EE企业级Web应用开发系统框架,如Web work等,Struts为Java Web 应用提供了现成的通用的框架,它可以提高软件开发的速度和效率,并且使软件更便于维护。
发明内容
本发明的目的是提供一种在线教育网站的设计方法,其具有提高软件开发的速度和效率,并且使软件更便于维护的优点。
 本发明解决其技术问题采用的技术方案是利用Struts 的Tiles 框架,建立起来网站导航页面部分( menu.jsp)、内容显示页面部分(content.jsp)、页尾部分(footer.jsp)的基本框架,构成网站框架的Tiles 组件代码如下:
layout.jsp:
<?xml version="1.0" encoding="UTF- 8"?>
<!DOCTYPE tiles- definitions PUBLIC "- //Apache Software Foundation//
DTD Tiles Configuration 1.1//EN" "http://jakarta.apache.
org/struts/dtds/tiles- config_1_1.dtd">
<tiles- definitions>
<definition name="base" path="/jsp/layout.jsp">// 定义了名为base
的Tiles 组件
<put name="menu" value="/jsp/menu.jsp"/>// 页面导航部分
<put name="content"/>// 内容显示页面
<put name="footer" value="/jsp/footer.jsp"/>// 页尾部分
</definition>
<definition extends="base" name="index">
<put name="content" value="/jsp/second.jsp"/>
</definition>
</tiles- definitions>
 本发明的有益效果是利用Struts 在web 设计中的应用来设计网站基本框架的方法,大大的节省了设计人员在设计网站整体框架时的时间,而且思路清晰,结构简单,减少了很多冗余代码。Struts 技术在网页设计领域为我们提供了新的思路,希望对我们今后在web 开发方面有更深层次的研究。
具体实施方式
下面结合具体实施例对本发明作进一步说明:本方法是利用Struts 的Tiles 框架,建立起来的网站的三部分页面的基本框架,Tiles- defs.xml 是Struts 的Tiles 框架配置文件,主要功能是定义了Tiles 框架中的Jsp 页面在框架的什么位置,并把value 所表示的JSP 页面插入到指定的JSP 框架页面中。导航页面部分( menu.jsp) 、内容显示页面部分(content.jsp)、页尾部分(footer.jsp)。构成网站框架的Tiles 组件代码如下,它描述网站的整体页面
layout.jsp:
<?xml version="1.0" encoding="UTF- 8"?>
<!DOCTYPE tiles- definitions PUBLIC "- //Apache Software Foundation//
DTD Tiles Configuration 1.1//EN" "http://jakarta.apache.
org/struts/dtds/tiles- config_1_1.dtd">
<tiles- definitions>
<definition name="base" path="/jsp/layout.jsp">// 定义了名为base的Tiles 组件
<put name="menu" value="/jsp/menu.jsp"/>// 页面导航部分
<put name="content"/>// 内容显示页面
<put name="footer" value="/jsp/footer.jsp"/>// 页尾部分
</definition>
<definition extends="base" name="index">
<put name="content" value="/jsp/second.jsp"/>
</definition>
</tiles- definitions>
1 在线教育网站功能设计
本方法设计的在线教育系统是一个小型的在线教育类网站, 使用该系统可以为用户提供在线教案学习、在线作业上传、资料浏览、成绩查询、教师发布教案、批改作业、学员和老师资料查询、留言板等服务。特规划网站的功能如下:会员管理模块、学生学习模块、老师教学模块、新闻发布模块、资源中心模块、系统管理模块等。
2 在线教育网站数据库结构设计
本在线教育网站系统采用ORACLE90 作为网站的后台数据库,作为一个教育网站, 数据库是非常重要的。它和SQL Server 相比,功能更加强大,并且ORACLE 是面向对象的大型关系数据库。数据项和数据结构如下:
(1)登录用户表:用户名、密码
(2)教师资料表: 教师编号、教师姓名、教师年龄、所属院校、职称;
(3)学生资料表: 学生编号、学生姓名、所属院校、联系方式、QQ;
(4)教案资料表: 教案编号、教案题目、所属科目、教案内容、发布日期、教师编号;
(5)作业资料表: 作业编号、上传文件名、上传内容、学生编号、教师编号、上传日期;
(6)批改作业表:作业编号、学生编号、教师编号、成绩。
3 基于Struts 框架在线教育网站实现
我们以查询作业模块为例说明基于Struts 框架教育网站实现方法。查询作业模块完成的功能是当教师打开批改作业页面homeworksearch.jsp 页面后,会对作业进行选择,可以按学生编号或老师编号选择你所想批改的作业,当输入表单完成后,进行表单的逻辑验证,逻辑验证主要是判断是否输入信息或信息的格式是否符合要求,当表单逻辑验证没有问题后,就转到了表单的业务验证。
具体实现为:首先学生上传了作业,才可以被老师检索到,然后对它进行批改评分。作业上传是把相关的作业文件插入到数据库的homeworks 表中,而批改作业则是把在数据库的homeworks 表中的记录取出来,存放到目标文件下,然后在作业显示页面homeworkshow.jsp页面下制作一个显示表格,有关文件的学生编号、作业编号、和文件名取出制作成一个超连接的形式,只要老师在显示页面点击这个超连接,就会在IE 浏览器上自动下载或是打开这个文件了。以下部分程序代码完成了从数据库中查找并提取作业内容,显示在页面上的功能,具体代码如下:
public static ArrayList search (String by, String condition, Connection
con,String path) // 创建了一个静态方法search(), 返回类型为链表类型
{
ArrayList returnValues = newArrayList();// 定义了一个返回变量
PreparedStatement pstmt = null;// 创建了一个预声明语句对象
ResultSet rs = null;// 创建了一个结果集
homeworksearch temp = null;// 创建了一个homeworksearch 类型的对象
try {
String sql;
if (by.equals("1")) {// 根据表单中关键字的值。选择sql 语句
sql = "SELECT * FROMhomeworksWHERE sid=?";
}else {
sql = "SELECT * FROMhomeworksWHERE tid=?";
}
pstmt = con.prepareStatement(
sql);// 通过连接对象获取语句
pstmt.setString(1, condition);// 把表单中传过来的条件赋到sql语句中
rs = pstmt.executeQuery ();// 把从表中得到的记录存到结果集rs 中
while (rs.next()) {// 遍历记录,把得到的记录存到temp 对象中
temp = newhomeworksearch(rs.getString("hid"),
rs.getString("sid"),
rs.getString("tid"),
rs.getString("hfilename"),
null,// 文件类型blob 先不获取,在下面得到
rs.getString("hdate"));
returnValues.add(temp);// 把结果集添加到返回变量中
Blob blob = rs.getBlob("hcontent");// 从rs 结果集中得到文件
的具体内容
InputStreamis = blob.getBinaryStream();// 定义一个输入流对象,用于从数据库中读取二进制数据
FileOutputStreamos = newFileOutputStream(path +
temp.getSid() + "_" + temp.getHid() + "_" +
temp.getHsubject());
// 定义一个文件输出流对象,用于把读出的文件,写到指定的目录下,并给新文件起了名字
int bytesRead = 0;// 定义了一个读文件变量
byte [] buffer = newbyte [8192];// 定义了一个字节类型的数组, 用于存储数据
while ((bytesRead = is.read(buffer, 0, 8192)) != - 1) {// 如果读的文件不为空
os.write (buffer, 0, bytesRead);// 把文件的数据写入到相应的目标目录下
}
is.close();// 关闭输入流
os.close();// 关闭输出流
}
}catch (SQLException ex) {
System.out.println(ex.toString());
}catch (IOException ex1) {
}
return returnValues;
}

Claims (1)

1. 一种在线教育网站的设计方法,其特征是利用Struts 的Tiles 框架,建立起来网站导航页面部分( menu.jsp)、内容显示页面部分(content.jsp)、页尾部分(footer.jsp)的基本框架,构成网站框架的Tiles 组件代码如下:
layout.jsp:
<?xml version="1.0" encoding="UTF- 8"?>
<!DOCTYPE tiles- definitions PUBLIC "- //Apache Software Foundation//
DTD Tiles Configuration 1.1//EN" "http://jakarta.apache.
org/struts/dtds/tiles- config_1_1.dtd">
<tiles- definitions>
<definition name="base" path="/jsp/layout.jsp">// 定义了名为base
的Tiles 组件
<put name="menu" value="/jsp/menu.jsp"/>// 页面导航部分
<put name="content"/>// 内容显示页面
<put name="footer" value="/jsp/footer.jsp"/>// 页尾部分
</definition>
<definition extends="base" name="index">
<put name="content" value="/jsp/second.jsp"/>
</definition>
</tiles- definitions>
CN201210494673.8A 2012-11-28 2012-11-28 一种在线教育网站的设计方法 Pending CN103530103A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210494673.8A CN103530103A (zh) 2012-11-28 2012-11-28 一种在线教育网站的设计方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210494673.8A CN103530103A (zh) 2012-11-28 2012-11-28 一种在线教育网站的设计方法

Publications (1)

Publication Number Publication Date
CN103530103A true CN103530103A (zh) 2014-01-22

Family

ID=49932149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210494673.8A Pending CN103530103A (zh) 2012-11-28 2012-11-28 一种在线教育网站的设计方法

Country Status (1)

Country Link
CN (1) CN103530103A (zh)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004062248A1 (en) * 2002-12-31 2004-07-22 Motorola, Inc, A Corporation Of The State Of Delaware System and method for distributed authorization and deployment of over the air provisioning for a communications device
CN101877111A (zh) * 2010-04-08 2010-11-03 苏州德融嘉信信用管理技术有限公司 网上银行业务平台及其运行方法

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004062248A1 (en) * 2002-12-31 2004-07-22 Motorola, Inc, A Corporation Of The State Of Delaware System and method for distributed authorization and deployment of over the air provisioning for a communications device
CN101877111A (zh) * 2010-04-08 2010-11-03 苏州德融嘉信信用管理技术有限公司 网上银行业务平台及其运行方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
鲍捷等: ""基于Struts框架结构的在线教育网站设计"", 《科技经济市场》 *

Similar Documents

Publication Publication Date Title
Salaba et al. Cataloging and classification: an introduction
Hoffer et al. Modern database management
Baker-Eveleth et al. Lowering business education cost with a custom professor-written online text
Yahui Impact data-exchange based on XML
CN103530103A (zh) 一种在线教育网站的设计方法
Nisha et al. Searching quranic verses: A keyword based query solution using. net platform
CN103246962A (zh) 企业综合信息管理系统
Qili et al. The difficulties and possibilities of cross-cultural communication: A case study of the global development of the Confucius Institutes
Nie Design and implementation of JAVA-based piano teaching management system
Guerrini et al. RDA: Resource Description and Access: the new standard for metadata and resource discovery in the digital age.
Kumar et al. Library management system
Ai et al. Design and Implementation of Teaching Case Database Based on Web
Pansare et al. Smart college event management system using MERN Stack
Lai et al. Design and Implementation of an Integrated Network Teaching Platform Based on SSH
Kellenberger et al. Beginning T-SQL
Tidake et al. Training and Placement Database Management System
Wang et al. Design and implementation of management system based on educational technology
KH Re-emergence of CDS/ISIS and scope for cultural information systems: Unicode compliance and current relevance in Indian Context
Li et al. Database Design on Resource Transmission System for Philosophy of Science
Mahony Language and the Subjects of Study in the Digital Humanities
Chen et al. A design and implementation of the online curriculum system based on the browser/server ArCHitecture
Winograd et al. HCI at Stanford University
Kellenberger et al. Beginning T-SQL 2012
Zhang et al. Applied Technology in an Interactive Design for a Web-Based Language Teaching System
Leelayuttho et al. KidBright: An Open-Source Embedded Programming Platform with a Dedicated Software Framework in Support of Ecosystems for Learning to Code

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20140122

WD01 Invention patent application deemed withdrawn after publication