收藏 分享(赏)

基于JSP网页自动生成工具的设计与实现(Design and implementation of automatic web page generation tool based on JSP).doc

上传人:dreamzhangning 文档编号:2792915 上传时间:2018-09-27 格式:DOC 页数:13 大小:39KB
下载 相关 举报
基于JSP网页自动生成工具的设计与实现(Design and implementation of automatic web page generation tool based on JSP).doc_第1页
第1页 / 共13页
基于JSP网页自动生成工具的设计与实现(Design and implementation of automatic web page generation tool based on JSP).doc_第2页
第2页 / 共13页
基于JSP网页自动生成工具的设计与实现(Design and implementation of automatic web page generation tool based on JSP).doc_第3页
第3页 / 共13页
基于JSP网页自动生成工具的设计与实现(Design and implementation of automatic web page generation tool based on JSP).doc_第4页
第4页 / 共13页
基于JSP网页自动生成工具的设计与实现(Design and implementation of automatic web page generation tool based on JSP).doc_第5页
第5页 / 共13页
点击查看更多>>
资源描述

1、基于 JSP网页自动生成工具的设计与实现(Design and implementation of automatic web page generation tool based on JSP)On high, wed be two birds flying wing to wing. On earth, two trees with branches twined from spring to spring。 The high shore Valley, great change. Warm wind birds broken, high heavy shadows. Never be c

2、ontented with your study; never be impatient with your teaching。 Yanshan snowflakes as big as a seat, energy-saving. Abstract: Web development technology is an important aspect of Internet applications, and JSP is the most advanced technology developed by Web. It is the preferred technology of Web d

3、evelopers. However, since JSP requires higher Web developers, many of the average Web developers are not yet able to use this advanced technology. The design and implementation of JSP web page automatic generation tool based on template and tag library are discussed, and the concrete design idea and

4、 implementation method are put forward.Keywords: JSP; automatic generation; Web development; tag; tag library; templateCatalog:Introduction.21 system design goals and main technologies used .41.1 design goals. Four1.2 main technology.Four1.2.1 template technology.41.2.2 tag library technology. .42,

5、the composition and implementation of the system .62.1 system composition. Six2.2 system implementation. SevenImplementation of 2.2.1 template library and tag library. .72.2.2 system development environment. .113 conclusion.11IntroductionWith the popularity of WWW (World, Wide, Web), dynamic web tec

6、hnology is developing rapidly. From the original CGI (Common Gateway Interface) to ASP (Active Server Page), are to some extent to meet the needs of dynamic web development technology of web developers. But whether CGI or ASP have some limitations, such as the CGI server resources, ASP can only be u

7、sed together with Microsoft IIS, which limits the use of these technologies, which greatly hindered their popularization. The majority of the page developers are eager for a unified page development technology, the characteristics of the technology should have: nothing to do with the operating platf

8、orm, can run on any Web or application server; the application logic and page separation; provide code reuse, simplify the development process of Web interactive applications based on the program.JSP (Java, Server, Page) technology is designed to meet this requirement. JSP was launched by Sun MicroS

9、ystem company in June 1999 of the new web development technology, it is the development of Web technology Java serv let and the whole based on the Java system, is the extension of Servlet2.1API. With this technology, you can build advanced, secure and cross platform dynamic web sites.Java is the mai

10、nstream development technology in the future, and has many advantages. JSP is an important application technology of Java on Internet / Intranet Web, and has been widely supported and recognized. It can be integrated with various Java technologies to achieve very complex applications.As a text-based

11、, display centric development technology, JSP offers all the benefits of Java Servlet. In order to make logical and display functions separate, JSP can work with JavaBeans, Enterprise, JavaBeans (EJB) and Servlet.JSP developers can do most of the work related to web logic by using JavaBeans, EJB, an

12、d Servlet, and simply hand over the displayed work to the JSP page. The benefit of separating content from display logic is that the person who updates the appearance of the page does not have to understand the Java code, and the person who updates the Java class does not have to be an expert in des

13、igning a web page. This allows you to define a Web template with a JSP page with a Java class to build a web of pages with a similar look. The Java class completes the data supply, and there is no Java code in the template, which means that these templates can be maintained by a HTML writer.JSP, as

14、the current mainstream web development technology, has the following characteristics.1) separating content creation from display: using JSP technology, Web page developers can use HTML or XML tags to design and format the final page. Use JSP tags or small scripts to generate dynamic content on the p

15、age (content is changed according to the request). The logic that generates the content is encapsulated in the identification and JavaBeans components and bundled in a small script, and all scripts run on the server side. If the core logic is encapsulated in the logo and JavaBeans, then others, such

16、 as Web administrators and page designers, can edit and use the JSP page without affecting the generation of content.2) emphasizes reusable components: the vast majority of JSP pages rely on reusable, cross platform components to accomplish the more complex processing required by the application. Th

17、anks to Javas platform independence, developers can easily share and communicate components that perform common operations, or make these components available to more users. The component-based approach accelerates the overall development process and greatly improves the overall development efficien

18、cy of the project.Although JSP is powerful, it requires web developers to be pretty familiar with Java. And now Java programmers are still relatively small, and for ordinary web developers, the syntax of JSP is still relatively difficult to master. So, you need to have a web development tool provide

19、s commonly used JSP application for general web developers to understand only the general page development technology (HTML) developers can also use strong function of JSP.1 system design goals and main technologies used1.1 design goalsThe design goal of this system is to know only HTML but did not

20、understand the JSP page developers to provide a web development tools, so that they can according to the system documentation, commonly used functions by using JSP tags, and finally generate a contains only static HTML and dynamic JSP page JSP tags.1.2 main technologyIn the design of this system, ma

21、inly consider the use of templates and JSP tag technology to achieve.1.2.1 template technologyTemplate technology has been widely used in various development and application systems. It generates some common framework, users can according to their own needs conveniently choose the template from the

22、template storehouse, rather than their own to build, saves the user development time, easy to use. In this system, the pages are classified according to function types, and the common page types are summed up to form the template library.1.2.2 tag library technologyIn JSP, actions are elements that

23、create and access program language objects and affect output streams. JSP defines six standard actions. In addition to these six standard actions, the user can define his actions to perform specific functions. These actions are called custom actions, and they are reusable program modules. Through th

24、ese actions, the programmer can encapsulate the page display function in the JSP page, so that the whole page is more concise and easy to maintain. In a JSP page, these customized actions are invoked through custom tags. The tag library (Tag Library) is a collection of custom tags.The JSP tag librar

25、y is a method for generating XML based scripts through JavaBeans. It is one of the biggest features of JSP. Through tag libraries, JSP applications can be extended indefinitely to accomplish any complex application requirements.The JSP tag library has the following features.1) easy to use: the label

26、s in JSP are the same as those of HTML in general, and are as convenient to use as regular HTML tags.2) easy to code reuse: each tag in the tag library can perform certain functions. Once defined a tag library, only need to put the tag library is packaged into a Jar file, then as long as the other s

27、ystems use this tag library on the line, without RE development code, greatly improve the system development efficiency, reduce development costs.3) easy to code maintenance: all of the application logic is encapsulated in the tag handler and JavaBeans, and all tags are concentrated in a tag library

28、. If you need to update the code, or you need to modify the functionality on a page, you just need to change the appropriate tag. Through this unified maintenance method, without making changes on each page, the workload of maintenance is greatly reduced and the maintenance cost is saved.4) easy to

29、extend: if you need to add new functionality to your system, you only need to define a new tag to complete this function without any changes to other aspects of the system. Tag libraries can inherit all aspects of the JSP specification. This allows you to extend and increase JSP functionality indefi

30、nitely without waiting for the next version of JSP to appear.2, the composition and implementation of the system2.1 system compositionThe system consists of four parts, as shown in figure 1.1) database connection part: this system supports several common database, including Oracle, Sybase, MSSQLServ

31、er, MySQL and DB2, according to the user to select the type of database and user database name, username, password using JDBC with database.2) system basic table generation part and database connection, the two generation system the basic table TCTables and TCColumns according to the same database n

32、ame, table name, English TCTables contains all the tables belonging to the user in the database of the Chinese name and some attributes, such as whether it can be modified, can inquire about TCColumns; the table contains belonging to the user in the database of all all columns of the table in the En

33、glish name and other properties. Such as whether it can be displayed or not. The basic table of these two systems provides basic information about the database used by the user during the development of the whole system.3) template selection and web page generation part: this part is the core part o

34、f the system. It contains two sub modules.Template selection: the system provides users with a template selection interface that allows users to select templates to use from the template library as needed.Template processing part: according to the template selected by user, the system calls the spec

35、ified template processing module to process the template. When a handler encounters a tag in a template, it provides the user with an interactive interface that allows the user to enter parameters for the specified tag and validate the validity of the tags entered by the user by the system. Finally,

36、 the JSP page is generated by the system.4) web preview and modify part: after the web page is generated, the system provides a preview window and code for the user to view and modify the window. With this preview window, the user can preview the effect of the resulting JSP page. If the user is not

37、satisfied with the static aspect of the page, the user can view the modified window through the code and modify the HTML code in the code. If the users static result to the page for further requirements, the system also provides a call to the DreamWeaver editor interface to the user, the user can us

38、e it to generate the static effect on the JSP page for further modification and perfection.Two2 system implementationImplementation of 2.2.1 template library and tag libraryThe planning and design of tag libraries is very important in the whole system design. It is related to the degree of code reus

39、e and the efficiency of system operation. Its planning should follow the following principles.1) the tag should contain as little static HTML as possible. For the average user, the tag is transparent. The user is unable to view and modify the tag. If the label contains too many static ht-ml sentence

40、, will affect the static effect of the user to the page of the revision and perfection, limit the use of the label.2) try to improve code reuse. In classifying JSP applications, it is possible to extract common JSP applications and form tags. Instead of repeating the application in each tag. Thus, i

41、n order to modify and improve the application later, it is only necessary to modify this tag, and it is easy to maintain the code.3) the use of convenient users. When designing tag libraries, full use of the users needs should be taken into account, allowing users to easily and easily understand and

42、 use tags.Definition of a tag library: to define a tag library, you must first define a tag library description file (TLD). This is a XML based script file, in this document defines the definition and description of parameters include the name of the XML version, use the encoding, tag library versio

43、n, the version of JSP you are using, and the tag library in the library all the labels, including the label name, Java the corresponding label, label description information etcImplementation of tags: a tag is a special JavaClass, this class must inherit the TagSupport class, defined in the javax.se

44、rvlet.jsp.tagext package. In the tag class, the parameter initialization method (Set / Get), the body handling method of the tag (Handler), and the method for calling the next level tag are included in the tag.Template implementation: a template is a JSP file containing tag references. In order to r

45、efer to the defined tags in a template, the tag library must first be introduced.%Where URI specifies the path of the tag library description file; prefix specifies the prefix to use when referencing the tag.When referencing a specified tag in a template, specify the name of the tag using the prefix

46、 specified by the tag library, and assign the parameter to the tag.2.2.2 system development environmentThis system main program is developed using Borland JBuilder 6, the use of Microsoft template development company FrontPage2000, tag library is developed using the UltraEdit editor, JDK is used in

47、JDK1.4. The system test environment is JRun3.0.3 conclusionJava is the mainstream of the future development language, and the main application of Java on Web will also be the mainstream technology of Web development in the future JSP. The system uses one of the biggest features of JSP tag library, s

48、o that the general Web developers can also easily use JSP powerful dynamic page function, developed a technologically advanced JSP dynamic Web pages. As the system is developed with Java, it can be operated on any graphical interface operating system, so that it is completely independent of the plat

49、form. The system is easy to expand and perfect. In the future, users can consider providing interfaces, allowing users to expand their own template library and tag library, to further enhance the function of the system.Reference1 Cay, S.Horstmann, Gary, Cornell.Java 2 core technology (CoreJava 2) M. Beijing: Mechanical Industry Press2 Bruce Eckel.Java programming thought (Thinking, in, Java) M. Beijing: Mechanical Industry Press3 Joseph L.Weber.java 2编程详解 (using java 2) m.北京: 电子工业出版社.4 borland 公司.building applications with jbuilder.玉不琢, 不成器; 人不学, 不知道.蚍蜉撼大树, 可笑不自量.相顾无相识, 长

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 大学课件

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报