文档库 最新最全的文档下载
当前位置:文档库 › JSP技术

JSP技术

JSP技术
JSP技术

JSP技术简介及特点——外文翻译

JSP Technology Conspectus And Specialties By:Kathy Sierra and Bert Bates Source: Servlet&JSP The JSP (Java Server mix) technology is used by the Sun microsystem issued by the company to develop dynamic Web application technology. With its easy, cross-platform, in many dynamic Web application programming languages, in a short span of a few years, has formed a complete set of standards, and widely used in electronic commerce, etc. In China, the JSP now also got more extensive attention, get a good development, more and more dynamic website to JSP technology. The related technologies of JSP are briefly introduced. The JSP a simple technology can quickly and with the method of generating Web pages. Use the JSP technology Web page can be easily display dynamic content. The JSP technology are designed to make the construction based on Web applications easier and efficient, and these applications and various Web server, application server, the browser and development tools work together. The JSP technology isn't the only dynamic web technology, also not the first one, in the JSP technology existed before the emergence of several excellent dynamic web technology, such as CGI, ASP, etc. With the introduction of these technologies under dynamic web technology, the development and the JSP. Technical JSP the development background and development history In web brief history, from a world wide web that most of the network information static on stock transactions evolution to acquisition of an operation and infrastructure. In a variety of applications, may be used for based on Web client, look no restrictions. Based on the browser client applications than traditional based on client/server applications has several advantages. These benefits include almost no limit client access and extremely simplified application deployment and management (to update an application, management personnel only need to change the program on a server, not thousands of installation in client applications). So, the software industry is rapidly to build on the client browser multi-layer application. The rapid growth of exquisite based Web application requirements development of technical improvements. Static HTML to show relatively static content is right choice, The new challenge is to create the interaction based on Web applications, in these procedures, the

JSP技术专题讨论

JSP技术专题讨论 JSP(Java Server Pages)介绍 是由Sun Microsystems公司倡导、许多公司参与一起建立的一种动态网页技术标准。JSP 技术有点类似ASP技术,它是在传统的网页HTML文件(*.htm,*.html)中插入Java程序段(Scriptlet)和JSP标记(tag),从而形成JSP文件(*.jsp)。 用JSP开发的Web应用是跨平台的,即能在Linux下运行,也能在其他操作系统上运行。 JSP技术使用Java编程语言编写类XML的tags和scriptlets,来封装产生动态网页的处理逻辑。网页还能通过tags和scriptlets访问存在于服务端的资源的应用逻辑。JSP将网页逻辑与网页设计和显示分离,支持可重用的基于组件的设计,使基于Web的应用程序的开发变得迅速和容易。 JSP与Java Servlet一样,是在服务器端执行的,通常返回该客户端的就是一个HTML文本,因此客户端只要有浏览器就能浏览。 JSP页面由HTML代码和嵌入其中的Java代码所组成。服务器在页面被客户端请求以后对这些Java代码进行处理,然后将生成的HTML页面返回给客户端的浏览器。Java Servlet 是JSP的技术基础,而且大型的Web应用程序的开发需要Java Servlet和JSP配合才能完成。JSP具备了Java技术的简单易用,完全的面向对象,具有平台无关性且安全可靠,主要面向因特网的所有特点。 自JSP推出后,众多大公司都支持JSP技术的服务器,如IBM、Oracle、Bea公司等,所以JSP迅速成为商业应用的服务器端语言。 JSP内置对象: 一、request对象: 该对象封装了用户提交的信息,通过调用该对象相应的方法可以获取封装的信息,即使用该对象可以获取用户提交信息。 二、response对象: 对客户的请求做出动态的响应,向客户端发送数据。 三、session对象 从一个客户打开浏览器并连接到服务器开始,到客户关闭浏览器离开这个服务器结束,被称

JSP技术简介(外文翻译)

JSP技术概述 一、JSP的好处 二、JSP页面最终会转换成servler。因而,从根本上,JSP页面能够执 行的任何任务都可以用servler来完成。然而,这种底层的等同性并不意味着servler和JSP页面对于所有的情况都等同适用。问题不在于技术的能力,而是二者在便利性、生产率和可维护性上的不同。毕竟,在特定平台上能够用Java编程语言完成的事情,同样可以用汇编语言来完成,但是选择哪种语言依旧十分重要。 和单独使用servler相比,JSP提供下述好处: 三、λJSP中HTML的编写与维护更为简单。JSP中可以使用常规的HTML: 没有额外的反斜杠,没有额外的双引号,也没有暗含的Java语法。 四、λ能够使用标准的网站开发工具。即使对那些对JSP一无所知的 HTML工具,我们也可以使用,因为它们会忽略JSP标签(JSP tags)。 五、λ可以对开发团队进行划分。Java程序员可以致力于动态代码。Web 开发人员可以将经理集中在表示层(presentation layer)上。对于大型的项目,这种划分极为重要。依据开发团队的大小,及项目的复杂程度,可以对静态HTML和动态内容进行弱分离(weaker separation)和强分离(stronger separation)。 六、在此,这个讨论并不是让您停止使用servlets,只使用JSP。几乎 所有的项目都会同时用到这两种技术。针对项目中的某些请求,您可能会在MVC构架下组合使用这两项技术。我们总是希望用适当的工具完成相对应的工作,仅仅是servlet并不能填满您的工具箱。 二、JSP相对于竞争技术的优势 许多年前,Marty受到邀请,参加一个有关软件技术的小型(20个人)研讨会.做在Marty旁边的人是James Gosling--- Java编程语言的发明者。 隔几个位置,是来自华盛顿一家大型软件公司的高级经理。在讨论过程中,研讨会的主席提出了Jini的议题,这在当时是一项新的Java技术.主席向该经理询问他的想法.他继续说,他们会持续关注这项技术,如果这

JSP简介

JSP(JavaServer Pages)是由Sun Microsystems公司倡导、许多公司参与一起建立的一种动态网页技术标准。JSP技术有点类似ASP技术,它是在传统的网页HTML文件(*.htm,*.html)中插入Java程序段(Scriptlet)和JSP标记(tag),从而形成JSP文件(*.jsp)。 用JSP开发的Web应用是跨平台的,即能在Linux下运行,也能在其他操作系统上运行。 JSP技术使用Java编程语言编写类XML的tags和scriptlets,来封装产生动态网页的处理逻辑。网页还能通过tags和scriptlets访问存在于服务端的资源的应用逻辑。JSP将网页逻辑与网页设计和显示分离,支持可重用的基于组件的设计,使基于Web的应用程序的开发变得迅速和容易。 Web服务器在遇到访问JSP网页的请求时,首先执行其中的程序段,然后将执行结果连同JSP文件中的HTML代码一起返回给客户。插入的Java程序段可以操作数据库、重新定向网页等,以实现建立动态网页所需要的功能。 JSP与Java Servlet一样,是在服务器端执行的,通常返回该客户端的就是一个HTML文本,因此客户端只要有浏览器就能浏览。 JSP的1.0规范的最后版本是1999年9月推出的,12月又推出了1.1规范。目前较新的是JSP1.2规范,JSP2.0规范的征求意见稿也已出台。

JSP页面由HTML代码和嵌入其中的Java代码所组成。服务器在页面被客户端请求以后对这些Java代码进行处理,然后将生成的HTML页面返回给客户端的浏览器。Java Servlet 是JSP的技术基础,而且大型的Web应用程序的开发需要Java Servlet和JSP配合才能完成。JSP具备了Java技术的简单易用,完全的面向对象,具有平台无关性且安全可靠,主要面向因特网的所有特点。 1.JSP技术的强势 (1)一次编写,到处运行。在这一点上Java比PHP更出色,除了系统之外,代码不用做任何更改。 (2)系统的多平台支持。基本上可以在所有平台上的任意环境中开发,在任意环境中进行系统部署,在任意环境中扩展。相比ASP/PHP的局限性是现而易见的。 (3)强大的可伸缩性。从只有一个小的Jar文件就可以运行Servlet/JSP,到由多台服务器进行集群和负载均衡,到多台Application进行事务处理,消息处理,一台服务器到无数台服务器,Java显示了一个巨大的生命力。 (4)多样化和功能强大的开发工具支持。这一点与ASP很像,Java已经有了许多非常优秀的开发工具,而且许多可以免费得到,并且其中许多已经可以顺利

JSP初级入门教程--JSP概述

jsp(iava server pages)是由sun 公司在java语言上开发出来的一种动态网页制作技术,其可使您可以将网页中的动态部分和静态的html相分离。您可以使用平常得心应手的工具并按照平常的方式来书写html语句。然后,将动态部分用特殊的标记嵌入即可,这些标记常常以“<%”开始并以“%>”结束。例如,这儿有一个jsp页面: <html> <head><title>jsp教程</title></head> <body> <i><%out.println(“hello world”);%></i> </body></html> 它将输出“hello world”。 通常,您要将文件以“.jsp”为扩展名,并将它放置到任何您可以放置普通web 页面的路径下。尽管jsp文件看起来更象是html文件而不是servlet文件,但,事实上,它恰恰将转换为servlet文件,其中的静态html仅仅用来输出servlet服务方法返回的信息。如果jsp pages 已经被转换为servlet且servlet 被编译进而被装载(在第一次被request时),当您再次request 此jsp页面时,将察觉不到一瞬的延迟。也请留意这个现象,一些web servers允许您为它定义别名,从而,好象一个url是指向一个html,但事实上它指向的是一个servlet 或jsp pages. 构造一个jsp page,除了可内嵌的规则的html,还有三类主要的jsp元素:scrīpting elements,directives,和actions.使用scrīpting elements您可以定义最终转换为servlet的部分,directives 使您可以控制这个servlet的整体结构,而actions 使您可以指定可重用的已有组件,另外,还可控制jsp引擎的运行。为了简化scrīpting elements,您可以在某一段上利用一些预定义的变量,如request。 本教程式是以jsp1.1版本进行讲解的。其语法概括如下表,其详细使用在随后的课程中详细讲解.

JSP技术英文简介

Introduction of JSP Technology JavaServer PagesTM (jsp (SUN enterprise application of choice)) technology for the creation of display content dynamically generated Web page provides a simple and rapid method. jsp (SUN enterprise application of choice) technology is designed to enable structure-based Web applications more easily and faster, and can these applications with a variety of Web servers, application servers, browsers, and development tools to work together. Here provides a jsp (SUN enterprise application of choice) technology overview, describes the background of its development, as well as the overall objective of this technology. At the same time, a simple example, also describes a JavaTM technology-based key component of the page. Web application development of JavaServer Pages technology Ways In the development of jsp (SUN enterprise application of choice) specification process, Sun Microsystems (Sun Microsystems Inc.) And many major Web servers, application servers and development tools providers, as well as a variety of experienced development groups to cooperate. The result is found a page for applications and developers to balance the portability and ease of use of development methodologies. Will generate and display the contents of the separation Using jsp technology, Web page developers can use HTML or xml logo to design and formatting the final page. Jsp logo or the use of bound feet would have to generate dynamic content on the page. The logic-generated content has been packaged in a logo and JavaBeans components and tied up in a small script, all the scripts in the server-side run. If the core logic was encapsulated in the logo and Beans, then other people, such as management and Web page designers, can edit and use jsp pages, without affecting the generation of content. The server side, jsp engine explained jsp logo and small script to generate the requested content (for example, by accessing JavaBeans components, the use of technology JDBCTM access the database, or include file), and the results to HTML (or xml) page of the form sent back to the browser. This helps the author to protect their code, and ensure that any HTML-based Web browser completely availability. Emphasis on reusable components Jsp page relies on the vast majority of reusable, cross-platform components (JavaBeans or Enterprise JavaBeansTM components) to implement the requirements of applications more complex treatment. Developers to be able to share and exchange components to perform common operations, or make these components more user or client groups to use. Component-based approach to accelerate the overall development process, and make a variety of organizations in their existing skills and to optimize the results of development efforts in the balance. Used to simplify page development logo Web page developers are not familiar with the scripting language of the programmer. JavaServer Page technology packages a number of functions, which are in use with the jsp-related xml logo in dynamic content generation needs. Jsp logo standards can access and instantiate JavaBeans components, set or retrieve components of property, download Applet, and implementation by other means more difficult to encode and time-consuming function. Through the development of customized logos library, jsp technology can be extended. In future, third-party developers and other personnel for commonly used features to create your own

JSP技术的运用实验报告

南昌大学实验报告 学生姓名:XXX 学号:xxxxxxxxxx 专业班级:xxxxxxx 实验类型:■验证□综合□设计□创新实验日期:xxxx.xx.xx 实验成绩: 一、实验项目名称: JSP技术的运用 二、实验目的 掌握JSP的基本语法、JSP指令和JSP动作以及JSP的内置对象,每种对象的使用方法与使用技巧,会简单的web应用程序的开发设计。 三、主要仪器设备及耗材 1.Myeclipse开发环境 2.Tomcat服务器 3.联想电脑一台 四、实验内容 1、运用Date函数读取系统当前时间,根据不同的时间段,在浏览器输出不同的问 候语 2、加载文件,制作一个jsp文件,计算一个数的平方,然后再制作一个jsp文件。 在客户端显示出来 3、设计表单。制作读者选购图书的界面,当读者选中一本图书后,单击“确定” 按钮,用”jsp:forward page=”语句将页面跳转到介绍该图书信息页面 4、设计求任意两个整数和的web程序,要求用户通过提交页面输入两整书,并提 交给一个jsp程序,再改程序中计算两个整数和。如果结果为正,跳出“结果为正” 页面,如果结果为负,跳出“结果为负”界面 5、设计一个用户注册表单,提交页面信息后,会输出用户填写的信息 五、实验步骤 1.应用Date函数读取系统当前时间,根据不同的时间段输出不同的问候,主要代码 如下: <%@page language="java"import="java.util.*"pageEncoding="UTF-8"%> 读取系统当前时间 <% Date date=new Date();%>

当前时间是:<%= date.toLocaleString()%>

jsp介绍外文翻译

外文原文 JSP JSP (JavaServer Pages) is initiated by Sun Microsystems, Inc., with many companies to participate in the establishment of a dynamic web page technical standards. JSP technology somewhat similar to ASP technology, it is in the traditional HTML web page document (*. htm, *. html) to insert the Java programming paragraph (Scriptlet) and JSP tag (tag), thus JSP documents (*. jsp). Using JSP development of the Web application is cross-platform that can run on Linux, is also available for other operating systems. JSP technology to use the Java programming language prepared by the category of XML tags and scriptlets, to produce dynamic pages package processing logic. Page also visit by tags and scriptlets exist in the services side of the resources of logic. JSP page logic and web page design and display separation, support reusable component-based design, Web-based application development is rapid and easy. Web server in the face of visits JSP page request, the first implementation of the procedures of, and then together with the results of the implementation of JSP documents in HTML code with the return to the customer. Insert the Java programming operation of the database can be re-oriented websites, in order to achieve the establishment of dynamic pages needed to function. JSP and Java Servlet, is in the implementation of the server, usually returned to the client is an HTML text, as long as the client browser will be able to visit. JSP 1.0 specification of the final version is launched in September 1999, December has introduced 1.1 specifications. At present relatively new is JSP1.2 norms, JSP2.0 norms of the draft has also been introduced. JSP pages from HTML code and Java code embedded in one of the components. The server was in the pages of client requests after the Java code and then will generate the HTML pages to return to the client browser. Java Servlet JSP is the technical foundation and large-scale Web application development needs of Java Servlet and JSP support to complete. JSP with the Java technology easy to use, fully object-oriented, and a platform-independent and secure, mainly for all the characteristics of the Internet. JavaScript, which is completely distinct from the Java programming language, is normally used to dynamically generate HTML on the client, building parts of the Web

JSP介绍

JSP简介 一、JSP介绍 JSP全名为Java Server Pages,中文名叫java服务器页面,其根本是一个简化的Servlet设计。JSP是SUN公司推出的,是J2EE(Java 2 Enterprise Edition,Java2企业版)十三种核心技术中最重要的一种。JSP是基Java 语言的一种Web应用开发技术,利用这一技术可以建立安全、跨平台的先进动态网站。如今,许多著名的Web网站都使用了JSP技术。 二、JSP技术概述 JSP技术有点类似ASP技术,它是在传统的网页HTML文件中插入Java程序段和JSP 标记,从而形成JSP文件,后缀名为(*.jsp)。用JSP开发的Web应用是跨平台的,既能在Linux下运行,也能在其他操作系统上运行。它实现了Html语法中的java扩展(以<%, %>形式)。JSP与Servlet一样,是在服务器端执行的。通常返回给客户端的就是一个HTML文本,因此客户端只要有浏览器就能浏览。 JSP技术使用Java编程语言编写类XML的tags和scriptlets,来封装产生动态网页的处理逻辑。网页还能通过tags和scriptlets访问存在于服务端的资源的应用逻辑。JSP 将网页逻辑与网页设计的显示分离,支持可重用的基于组件的设计,使基于Web的应用程序的开发变得迅速和容易。 JSP是一种动态页面技术,它的主要目的是将表示逻辑从Servlet中分离出来。 Java Servlet是JSP的技术基础,而且大型的Web应用程序的开发需要Java Servlet 和JSP配合才能完成。JSP具备了Java技术的简单易用,完全的面向对象,具有平台无关性且安全可靠,主要面向因特网的所有特点。 作为一种基于文本的、以显示为中心的开发技术,JSP以Java Servlet为基础,提供了Java Servlet的所有优点,并且当与一个JavaBeans类结合在一起时,提供了一种使内容和显示逻辑分开的简单方式。分开内容和显示逻辑使得更新页面外观的人员不必懂得Java代码,而更新JavaBeans类的人员也不必是设计网页的行家里手,就可以用带有JavaBeans类的JSP页面来定义Web模板,以建立一个由具有相似的外观的页面组成的网站。 三、JSP语言特点 1.优点 (1)一次编写,到处运行。除了系统之外,代码不用做任何更改。系统的多平台支持。基本上可以在所有平台上的任意环境中开发,在任意环境中进行系统部署,在任意环境中扩展。相比ASP的局限性JSP的优势是显而易见的。

JSP编程技术习题集及实训附答案

JSP编程技术习题集 第一章JSP技术基础习题 一、选择题 1.当用户请求jsp页面时,JSP引擎就会执行该页面的字节码文件响应客户的请求,执行字节码文件的结果是 A)发送一个JSP源文件到客户端 B)发送一个Java文件到客户端 C)发送一个HTML页面到客户端 D)什么都不做。 3.下列动态网页和静态网页的根本区别描述错误的是。 A)静态网页服务器端返回的HTML文件是事先存储好的 B)动态网页服务器端返回的HTML文件是程序生成的。 C)静态网页文件里只有HTML标记,没有程序代码。 D)动态网页中只有程序,不能有HTML代码。 4.不是JSP运行必须的是 A)操作系统 B)JavaJDK C)支持Jsp的Web服务器 D)数据库 7.Tomcat服务器的默认端口号是: A)80 B)8080 C)21 D)2121

第三章JSP语法基础 一、选择题 1.JSP的编译指令标记通常是指: A)Page指令、Include指令和Taglib指令 B)Page指令、Include指令和Plugin指令 C)Forward指令、Include指令和Taglib指令 D)Page指令、Param指令和Taglib指令 2.可以在以下哪个()标记之间插入Java程序片? A)<% 和%> B)<% 和/> C) D)<% 和!> 3.下列哪一项不属于JSP动作指令标记? A) B) C) D) 4.JSP的Page编译指令的属性Language的默认值是: A)Java B)C C)C#D)SQL 5.JSP的哪个指令允许页面使用者自定义标签库? A)Include指令B)Taglib指令 C)Include指令D)Plugin指令 6.可以在以下哪个()标记之间插入变量与方法声明? A)<% 和%> B)<%!和%> C) D)<% 和!> 7.能够替代<字符的替代字符是()?(C) A)< B)> C)< D)  8.动作标记中,scope的值不可以是。 A)page B)request C)session D)response 9.下列()注释为隐藏型注释。。 A) B) C)<%-- 注释内容--%> D)] --> 10.下列变量声明在()范围内有效。(C)。 <%! Date dateTime; int countNum; %> A)从定义开始处有效,客户之间不共享

JSP技术发展史

JSP的技术发展历史 作者:Kathy Sierra and Bert Bates 来源:Servlet&JSP Java Server Pages(JSP)是一种基于web的脚本编程技术,类似于网景公司的服务器端Java脚本语言——server-side JavaScript(SSJS)和微软的Active Server Pages(ASP)。与SSJS和ASP 相比,JSP具有更好的可扩展性,并且它不专属于任何一家厂商或某一特定的Web服务器。尽管JSP规范是由Sun公司制定的,但任何厂商都可以在自己的系统上实现JSP。 在Sun正式发布JSP(Java Server Pages)之后,这种新的Web应用开发技术很快引起了人们的关注。JSP为创建高度动态的Web应用提供了一个独特的开发环境。按照Sun的说法,JSP 能够适应市场上包括Apache WebServer、IIS4.0在内的85%的服务器产品。 本文将介绍JSP相关的知识,以及JavaBean的相关内容,当然都是比较粗略的介绍其中的基本内容,仅仅起到抛砖引玉的作用,如果读者需要更详细的信息,请参考相应的JSP的书籍。 1.1 概述 JSP(Java Server Pages)是由Sun Microsystems公司倡导、许多公司参与一起建立的一种动态网页技术标准,其在动态网页的建设中有其强大而特别的功能。JSP与Microsoft的ASP技术非常相似。两者都提供在HTML代码中混合某种程序代码、由语言引擎解释执行程序代码的能力。下面我们简单的对它进行介绍。 JSP页面最终会转换成servlet。因而,从根本上,JSP页面能够执行的任何任务都可以用servlet 来完成。然而,这种底层的等同性并不意味着servlet和JSP页面对于所有的情况都等同适用。问题不在于技术的能力,而是二者在便利性、生产率和可维护性上的不同。毕竟,在特定平台上能够用Java编程语言完成的事情,同样可以用汇编语言来完成,但是选择哪种语言依旧十分重要。 和单独使用servlet相比,JSP提供下述好处: JSP中HTML的编写与维护更为简单。JSP中可以使用常规的HTML:没有额外的反斜杠,没有额外的双引号,也没有暗含的Java语法。 能够使用标准的网站开发工具。即使是那些对JSP一无所知的HTML工具,我们也可以使用,因为它们会忽略JSP标签(JSP tags)。 可以对开发团队进行划分。Java程序员可以致力于动态代码。Web开发人员可以将经理集中在表示层(presentation layer)上。对于大型的项目,这种划分极为重要。依据开发团队的大小,及项目的复杂程度,可以对静态HTML和动态内容进行弱分离(weaker separation)和强分离(stronger separation)。 此处的讨论并不是说人们应该放弃使用servlet而仅仅使用JSP。事实上,几乎所有的项目都会同时用到这两种技术。在某些项目中,更适宜选用servlet,而针对项目中的某些请求,我们可能会在MVC构架下组合使用这两项技术。我们总是希望用适当的工具完成相对应的工作,仅仅是servlet并不一定能够胜任所有工作。 1.2 JSP的由来 Sun公司的JSP技术,使Web页面开发人员可以使用HTML或者XML标识来设计和格式化最终页面。使用JSP标识或者小脚本来生成页面上的动态内容(内容是根据请求来变化的)。Java Servlet是JSP技术的基础,而且大型的Web应用程序的开发需要Java Servlet和JSP配合才能完成,Servlet这个名称源于Applet,现在国内的翻译方式很多,本书为了避免误会,决定直接采用Servlet而不做任何翻译,读者如果愿意,可以称之为“小服务程序”。Servlet

【计算机专业文献翻译】JSP概述

JSP介绍 J2EE(Java2企业版)已经承担起了曾经很混乱的建立互联网平台的任务,并使开发者们能够使用Java来高效地创建多层服务器端应用程序。现今,Java企业版的API已经扩展为涵盖了众多领域:用于远程对象处理的RMI和CORBA,用于数据库交互的JDBC,用于访问命名和目录服务的JNDI,用于创建可重用商务组件的企业级JavaBeans(EJB),用于面向消息的中间件的JMS TM(Java Messaging Service,Java消息服务),用于XML处理的JAXP TM,以及用于执行原子性(atomic)事务的JTA TM(Java Transaction API,Java事务API)。另外,J2EE还支持servlets是一种非常流行的用于替代CGI脚本的Java小程序。这些技术的组合使得程序员可以为各种不同的任务创建分布式的商务解决方案。 在1999年末,Sun Microsystems公司向企业级Java工具集中加入了一个新的元素:Java Server Pages(JSP,Java服务器页面)。JSP建立在Java servlet之上,它的设计目的是使程序员乃至非程序员都能高效地创建Web内容。 什么是JSP? 简明扼要地说,JSP是一种用来开发含有动态内容网页的技术。纯HTML页面只包含静态的内容,它的内容通常保持不变,而JSP页面则不同,它可以根据任意数量的变量来改变自己的内容,这些变量包括用户的身份信息,用户使用的浏览器类型,用户提供的信息,以及用户所做的选择等。 JSP页面就和常规的网页一样,包含标准的标记语言元素,例如HTML的标签。然而,JSP页面还包含特殊的JSP元素,这些元素使得服务器可以把动态内容插入到网页中。JSP 元素的用途非常广泛,例如从数据库取得信息,或记录用户的个性信息。当用户请求一个JSP页面时,服务器先执行JSP元素,并把结果同网页的静态部分相结合,然后把动态合成后的页面送回到浏览器。 JSP定义了许多用于Web应用程序的有用的标准元素,例如访问JavaBeans组件的元素,在页面间传递控制权的元素,以及在请求,页面和用户间共享信息的元素。程序员也可以通过使用应用程序的专用元素来扩展JSP语法,从而完成像访问数据库和EJB,发送电子邮件,生成表示应用程序专用数据的HTML这样的任务,与JSP规范相关的规范(JSTL规范)定义了一组这种常用的自定义元素。标准元素和自定义元素的组合确保了可以开发出强大的Web 应用程序。 为什么要使用JSP? 在Web发展的早期,CGI(Common Gateway Interface,公共网关接口)是开发动态Web 内容的唯一工具,然而,CGI并非一种高效率的解决方案。对每一个传来的请求,Web服务器都必须创建一个新的操作系统进程,载入一个解释器和一个脚本,接着执行这个脚本,然后再把这些全部释放掉。这使得服务器承受着繁重的负担,而且当通信量增加时性能会变得很低。 过去几年里,出现了许多CGI的替代品和增强版,例如FastCGI,Apache的mod_perl,Netscape的NSAPI,Microsoft的ISPAI和Sun Microsystems的Java servlet。虽然这些解决方案能提供更高的性能和可缩放性,但是所有这些技术都面临着同一个问题:它们都是通过把HTML代码直接嵌入到程序语言代码中来生成网页。这使得动态网页的创建成为程序员所独立的领域。然而,JSP改变了这一切。 在HTML页面中嵌入动态元素

JSP的技术发展历史

THE TECHNIQUE DEVELOPMENT HISTORY OF JSP By:Kathy Sierra and Bert Bates Source: Servlet&JSP The Java Server Pages( JSP) is a kind of according to web of the script plait distance technique, similar carries the script language of Java in the server of the Netscape company of server- side JavaScript( SSJS) and the Active Server Pages(ASP) of the Microsoft. JSP compares the SSJS and ASP to have better can expand sex, and it is no more exclusive than any factory or some one particular server of Web. Though the norm of JSP is to be draw up by the Sun company of, any factory can carry out the JSP on own system. The After Sun release the JS P( the Java Server Pages) formally, the this kind of new Web application development technique very quickly caused the people's concern. JSP provided a special development environment for the Web application that establishes the high dynamic state. According to the Sun parlance, the JSP can adapt to include the Apache WebServer, IIS4.0 on the market at inside of 85% server product. This chapter will introduce the related knowledge of JSP and Databases, and JavaBean related contents, is all certainly rougher introduction among them basic contents, say perhaps to is a Guide only, if the reader needs the more detailed information, pleasing the book of consult the homologous JSP. 1.1 GENER ALIZE The JSP(Java Server Pages) is from the company of Sun Microsystems initiate, the many companies the participate to the build up the together of the a kind the of dynamic the state web the page technique standard, the it have the it in the construction the of the dynamic state the web page the strong but the do not the especially of the function. JSP and the technique of ASP of the Microsoft is very alike. Both all provide the ability that mixes with a certain procedure code and is explain by the language engine to carry out the procedure code in the code of HTML. Underneath we are simple of carry on the introduction to it. JSP pages are translated into servlets. So, fundamentally, any task JSP pages can perform could also be accomplished by servlets. However, this underlying equivalence does not mean that servlets and JSP pages are equally appropriate in all scenarios. The issue is not the power of the technology, it is the convenience, productivity, and maintainability of one or the other. After all, anything you can do on a particular computer platform in the Java programming language you could also do in assembly language. But it still matters which you choose.

相关文档