教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 学前教育 >

基于ASP的网站设计 - 图文(15)

来源:网络收集 时间:2026-04-30
导读: Generation of the response page is typically delegated to a JSP page. JavaServer Pages technology JSP pages are analogous to ASP pages. That is, they are HTML pages that also contain scripting elemen

Generation of the response page is typically delegated to a JSP page.

JavaServer Pages technology

JSP pages are analogous to ASP pages. That is, they are HTML pages that also contain scripting elements that execute on the server when a users requests the page. A key difference between ASP pages and JSP pages is that ASP uses VBScript or JScript as its scripting language, whereas JSP pages use the Java language. A typical JSP page contains snippets of Java code and some special HTML-like tags defined in the JSP specification, interleaved with standard HTML to provide a combination of static and dynamic content. The difference between the Java Servlets and JavaServer Pages technologies is conceptually similar to the difference between difference between an ISAPI filter and an ASP page. In both cases the former is a piece of code you can use to emit HTML directly or redirect to other resources, and the latter is an HTML document that can contain embedded code.

Web servers and application servers

As an ASP developer, you know that ASP pages are executed by a scripting engine that IIS invokes. You also can add ISAPI filters and COM components to your Web applications for IIS to invoke. This makes it easy to deploy Web applications on IIS. But it limits you to the Windows platform, the only one where IIS can run. J2EE uses a different approach because it's designed to run on a variety of operating systems (including Windows). Rather than attempt to embed the code to run Java Servlets and JSP pages directly into a Web server, it

46

uses a separate server component called an application server to run them. Most application servers (such as IBM WebSphere) also have separate plug-in components to bridge between the application server and specific Web servers. For example, WebSphere ships with separate plug-ins for IIS and the Apache Web server. This lets you use the Web server of your choice when you run J2EE components.

The application server's role as a separate, pluggable server component gives you several advantages:

Choice of Web servers: You're not tied to any one Web server to serve

up your static HTML pages. You can continue to use your favorite Web server for this purpose and use any application server to handle your Java Servlets and JSP pages. This capability is especially useful when you're porting an ASP application to J2EE. You can continue to run IIS and port your application in stages. You needn't rewrite the whole application in one fell swoop.

Choice of platform: You can write your J2EE application once and

deploy it on a variety of operating systems -- including Windows, AIX, and Linux -- where the application server can run. You're not limited by where a particular Web server can run.

Choice of application server vendors: Because industry-standard

specifications define the Java Servlets and JavaServer Pages technologies, you can write your J2EE application once and then deploy it to multiple application-server environments, such as WebSphere Express or Apache Tomcat,

47

a popular open source application server. J2EE also defines how you must package a Web application, so you can take an application you develop in one J2EE environment and redeploy it to another application server without needing to change your code or recompile the application. The same holds true for deploying an application to multiple platforms.

How an application server runs servlets and JSP code

As we mentioned earlier, the J2EE specification mandates a standard format for deploying Java Servlets and other J2EE components. An XML document called a deployment descriptor is part of this standard format. The deployment descriptor contains a mapping from each of your servlets to the URLs you use to invoke a particular servlet. An application server uses the information in the deployment descriptor to decide which servlet to invoke for a given request. …… 此处隐藏:1899字,全部文档内容请下载后查看。喜欢就下载吧 ……

基于ASP的网站设计 - 图文(15).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/598877.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)