2024年2月3日发(作者:)
外文翻译--JSP及其WEB技术
外文翻译原文及译文
JSP and WEB technolog
1 JSP Introduction
JSP (JavaServer Pages) is a Java-based scripting technology. Is advocated by Sun
Microsystems Inc., together with a number of companies involved in the establishment of a
dynamic web page technology standards. JSP technology is somewhat similar to ASP
technology, It is a traditional HTML page file (*. htm, *. html) to insert Java program
segment (Scriptlet) and JSP tag (tag), To form the JSP file(*jsp). Web development with
JSP is a cross-platform applications that can run under Linux, but also in other operating
systems. In the JSP of the many advantages, one of which is that it will be HTML encoded
Web page from the business logic separated effectively. JSP access with reusable
components, such as Servlet, JavaBean and Java-based Web applications. JSP also supports
directly in the Web page embedded Java code. JSP can be used two ways to access
documents: JSP documents sent by the browser request, the request sent to the Servlet. JSP
technology uses Java programming language, XML-type tags and scriptlets, to have a
package deal with the logic of dynamic pages. Page tags and scriptlets can also exist in the
server access to the resources of the application logic. JSP logic and Web page design and
display isolated and support reusable component-based design, Web-based applications
more quickly and easily developed.
The Web server when meets visits the JSP homepage the request, first carries out
segment, will then carry out the result code to return together with JSP in the document
HTML for the customer. The insertion Java segment may operate the database, again the
directional homepage and so on, realizes the function which the establishment dynamic
homepage needs. JSP and Java Servlet are the same, is in the server end execution, usually
returns to this client side is a HTML text, therefore client side, so long as has the browser
to be able to glance over.
The JSP page is composed of the HTML code and the inserting Java code. The
server in the page by the client side was requested that later will carry on processing to
these Java code, will then produce the HTML page will return gives the client side the
browser. Java Servlet is the JSP technology base, moreover the large-scale Web application
1
外文翻译--JSP及其WEB技术
procedure's development needs Java Servlet and the JSP coordination can complete. JSP
had the Java technology simply easy to use, complete object-oriented, had the platform
independency, and safe reliable, mainly faced Internet's all characteristics.
2 JSP computing technique
To carry on the dynamic website conveniently fast the development, JSP has made
the improvement in the following several aspects, causes it to become builds the cross
platform fast the dynamic website first choice plan.
2.1 carries on the content production and the demonstration separates
With the JSP technology, the Web page development personnel may use HTML or
the XML marking design and the formatted final page, and uses the JSP marking or the
tootsy produces on page's dynamic content originally. Production content's logic is sealed
in marks and in the JavaBeans module, and ties up in the script, all scripts in server end
movement. Because core logic is sealed in marks and in JavaBeans, therefore the Web
administrative personnels and the page designer, can edit and use the JSP page, but does
not affect the content the production. In the server end, the JSP engine explained that the
JSP marking and the script, produce the content which requested, and (or XML) page's
form transmits the result by HTML the browser. This both are helpful in the author protects
own code, and can guarantee any based on the HTML Web browser's complete usability.
2.2 may entrust with heavy responsibility the module
The overwhelming majority JSP page relies on may entrust with heavy responsibility,
the cross platform module (JavaBeans or Enterprise the JavaBeans module) carries out
complex processing which the application procedure requests. The development personnel
can share and exchange the execution ordinary operation the module, or causes these
modules uses for more users and the customer association. Has accelerated the overall
development process based on module's method, and causes each kind of organization
obtains balanced in their existing skill and in the optimized result development endeavor.
2.3 uses marking
The Web page development personnel will not be the familiar script language
programmers. The JSP technology has sealed many functions, these functions are easy to
2
外文翻译--JSP及其WEB技术
use, marking to carry on the dynamic content production with JSP in the related XML to
need. The standard JSP marking can visit and the instantiation JavaBeans module, the
establishment or the retrieval module attribute, downloads Applet, as well as the execution
difficulty with codes and the time-consuming function with other methods.
2.4 adapts the platform
Nearly all platforms support Java, JSP+JavaBeans to be possible to pass unimpeded
nearly under all platforms. Transplants from a platform to other platform, JSP and
JavaBeans does not even need to translate, because the Java byte code is standard has
nothing to do with the platform.
2.5 database connection
In Java connects the database the technology is the JDBC, Java procedure is
connected through the JDBC driver and the database, operations and so on execution
inquiry, extraction data. Sun Corporation has also developed JDBC-ODBC bridge, uses
this technical Java procedure to be possible to visit has the ODBC driver database, at
present the majority database systems have the ODBC driver, therefore the Java procedure
can visit such as Oracle, Sybase, MS SQL Server and databases and so on MS Access. In
addition, through the development marking storehouse, the JSP technology may further
expand. The third party development personnel and other personnel may found their
marking storehouse for the commonly used function. This enables the Web page
development personnel to be able to use the familiar tool and to be similar to marking same
carries out the specific function component to carry on the work. The JSP technology very
easy conformity to many kinds of application architecture, to use the extant tool and the
skill, and can expand to the support enterprise distributional application.
3 Eclipse function synopsis
More and more Java development personnel already started the productivity which
and the quality income appreciates Eclipse JDT to provide. It was the Java editor provides
grammar Gao Liang to demonstrate that the formatting, the fold, the content were auxiliary,
code template and so on many functions. It grows unceasingly available restructuring and
the code generation function set permits you in a higher rank the operation code, and
automated usual code intensity duty and easy wrong duty. Moreover, in develops the code
3
外文翻译--JSP及其WEB技术
and uses JDT to compile and to carry out the JUnit test built-in support carries on the unit
testing after the code, may use Eclipse the first-class Java debugger debugging when the
movement meets any question. Besides JDT, Eclipse SDK- the most popular
downloading - also contains Plug-in Development Environment(PDE). PDE used the
specific function to expand JDT to construct the Eclipse plug-in unit - based on the Eclipse
application procedure basic construction agglomeration. In fact, uses the tool which
provides by Eclipse itself to be able to surmount the Java development, may expand the
existing Eclipse application procedure, or even founds the brand-new application
procedure.
Eclipse by a script level constitution, contains in many functional modules or the
Eclipse terminology so-called “the plug-in unit”. The plug-in unit is provides all functions
in the Eclipse application procedure the module. They cooperate through its API to pay the
final outcome together. In Eclipse, even the most foundation's function, for instance the
search and the start installment's plug-in unit, seals in the plug-in unit. In order to expand
the existing Eclipse function or carry on the construction in above, the plug-in unit the
concrete expansion contribution for the expansion spot which will expose by other plug-in
units. Usually, the plug-in unit concentrates the specific region responsibility, and gives
through or a many expansion way other responsibility designation other plug-in units. For
example, a plug-in unit allows you parallel to compare two documents visibly the contents,
but it will not care how to read these documents even how to explain these document
structure; This is other plug-in unit's work. When compared with two documents, this
plug-in unit first inspects whether to have another plug-in unit to be possible to explain
these document structure. If found one, it to the plug-in unit inquiry related file
organization information which found, and used this information in the comparison
process.
May see that the modular construction was Eclipse has provided the huge flexibility,
and provided one to be possible to support the massive application procedure platform
which the original design has not expected.
4 Structs function synopsis
Struts is a MVC frame (Framework), uses in developing Java fast the Web application.
Struts realizes the key point in C(Controller), Action which and we have custom-made
4
外文翻译--JSP及其WEB技术
including ActionServlet/RequestProcessor, was also V(View) provides a series of rows to
have custom-made the label (Custom Tag). Spring is a light vessel (light-weight container),
its core is the Bean factory (Bean Factory), with constructs M(Model) which we need.
Above this foundation, Spring has provided AOP (Aspect-Oriented Programming, face
stratification plane programming) realization, provides under the non-management
environment with it to declare services and so on way business, security; Is more
convenient to Bean factory expansion ApplicationContext we to realize the J2EE
application; DAO/ORM realizes facilitates us to carry on the database the development;
Web MVC and Spring Web have provided Java the Web application frame or carries on the
integration with other popular Web frame. That is may a both use, achieve both own
characteristic carries on supplementary.
Structs is the kind which, servlet and the JSP mark a group cooperates mutually, they
compose the MVC 2 designs which may entrust with heavy responsibility. This definition
expressed that Struts is a frame, but is not a storehouse, but Struts has also contained the
rich mark storehouse and the independence in this frame work utility program class.
Client browser (customer browser), the request founds an event from customer
browser's each HTTP. The Web vessel will use a HTTP response to make the response.
Controller (controller), the controller receive from browser's request, and decided that
sends out where this request. Speaking of Struts, the controller is an order design pattern
which realizes by servlet. document disposition controller.
Service logic, the service logic renewal model's condition, and helps the control
application procedure the flow. Speaking of Struts, this is through takes the actual service
logic “thin” the packing Action kind to complete.
Model (model) condition, model expression application procedure condition. Service
object renewal application procedure condition. ActionForm bean in conversation level or
request level expression model condition, but is not in the lasting level. The JSP document
uses JSP to mark the read from the ActionForm bean information.
View (view), the view is a JSP document. And does not have the flow logic, does not
have the service logic, also does not have the model information -- Only then marks. The
mark causes Struts is different with other frames (for example Velocity) one of factors.
Just like the Struts controller is (event usually is HTTP post) maps the event kind of
servlet. you to expect - the air-operated controller use configuration files to cause you not
5
外文翻译--JSP及其WEB技术
to need to carry on to these values the hard code. The time has changed, but method as
before.
The Action kind, ActionForm maintains the Web application procedure the
conversation condition. ActionForm is one abstract class, must found this kind of subclass
for each input form model. When I said when input form model, what refers to the
ActionForm expression is establishes or in the renewal general sense data by the HTML
Action kind is service logic packing. A Action kind of use is transforms
HttpServletRequest into the service logic. Must use Action, please found its subclass and
covers process () the method.
ActionServlet (Command) will use perform () the method the parametrization kind to
transmit for ActionForm. Still did not have too many repugnant ameter () to
transfer. When the event progresses to this step, the input form data (or HTML form data)
has been withdrawn from the request class and shifts to the ActionForm kind.
Considered that a Action kind of another way is the Adapter design pattern. The
Action use will be “a kind of connection will transform another connection which will
need for the client. Adapter enables the kind the joint operation, if does not have Adapter,
then these kinds will be unable because of the incompatible connection the joint
operation.”. In this example's client is ActionServlet, it knows nothing about to our
concrete service class connection. Therefore, Struts has provided a service connection
which it can understand, namely Action. Through expands Action, we cause our service
connection and the Struts service connection maintain compatible.
5 CSS synopsis
The CSS edition method is the same with HTML, may also be any text editor or the
homepage edition software, but also has uses for to edit CSS specially the software. If you
write the CSS sentence regards the exterior cascading style sheet, but transfers in the
HTML document, then its extension saves .css to be possible. Initially the technical
personnel found out HTML, mainly stresses on the definition content, for instance
expressed that a paragraph, indicates the title, but excessively has not designed HTML the
typesetting and the contact surface effect.
Along with the Internet rapid development, HTML is widely applied, the surfer
people hoped certainly that the homepage makes attractive, therefore the HTML
6
外文翻译--JSP及其WEB技术
typesetting and the contact surface effect's limitation exposes day by day. In order to solve
this problem, the people also took many tortuous paths, has used some not good method,
for instance increases many attribute results to HTML becomes the code very extremely fat,
turns the picture the text, excessively many comes the typesetting using Table, expresses
the white space with the blank picture and so on. Appears until CSS.
CSS may be a homepage design breakthrough, it has solved the homepage contact
surface typesetting difficult problem. May such say that HTML Tag is mainly defines the
homepage content (Content), but CSS decided how these homepage content does
demonstrate (Layout). The CSS English is Cascading Style Sheets, Chinese may translate
the tandem cascading style sheet. CSS may divide into three kinds according to its position:
In inlays the style (Inline Style), internal cascading style sheet (Internal Style Sheet),
exterior cascading style sheet (External Style Sheet).
6 HTML function synopsis
Hyper Text Markup the Language hypertext mark language is one kind uses for to
manufacture the hypertext documents the simple mark language. The hypertext documents
which compiles with HTML are called the HTML documents, it can the independence in
each kind of operating system platform (for example UNIX, WINDOWS and so on).
HTML has served as since 1990 on World Wide Web the information to express the
language, uses in describing the Homepage form design and it and on WWW the other
Homepage linked information.
The HTML documents (i.e. the Homepage source document) was one has laid aside
the mark ASCII text document, usually it had .html or the .htm document extension.
Produces HTML documents mainly to have the following three ways: 1. the manual direct
compilation (e.g. ASCII text editor which or other HTML edition tool likes with you). 2.
will have other form documents through certain format conversion tool (for example the
WORD documents) to transform the HTML documents. 3. by the Web server (or said that
the HTTP server) one only then real-time dynamic produces. the HTML language is
through uses each kind of mark (tags) to mark the documents the structure as well as marks
the ultra chain (Hyperlink) the information.
Although the HTML language described the documents structure form, but how can't
define the documents information to precisely demonstrate and arrange, but is only
7
外文翻译--JSP及其WEB技术
suggested how the Web browser (for example Mosiac, Netscape and so on) should
demonstrate and arrange these information, is decided finally in front of user's
demonstration result by the Web browser's demonstration style and to the mark explanatory
ability. Why is the identical documents the effect which demonstrated in the different
browser meets is dissimilar. At present the HTML language's edition is 2.0, it is based on
SGML (Standard Generalized Markup Language, standard sets at sign language generally,
as soon as is applies mechanically describes digitized documents structure and manages its
content complex standard) a subset to evolve comes. Although in next edition's standard
HTML3.0 (is also called HTML+) to draw up, but some the partial experimental nature
draft standard widely has been used, the mostly outstanding Web browser (for example
Netscape and so on) can explain in the HTML3.0 part new mark, therefore introduced in
this chapter some HTML3.0 new mark has been accepted by the most browsers.
7 Js script language synopsis
JS is javascrip, Javascript is one kind the script language which comes by the
Netscape LiveScript development, the main purpose is to solve the server terminal
language, for instance Perl, carry-over speed question. At that time served the end to need
to carry on the confirmation to the data, because the network speed was quite slow, only
then 28.8kbps, the confirmation step waste's time were too many. Therefore Netscape
browser Navigator has joined Javascript, has provided the data confirmation basic
function.
The JavaScript official name is “ECMAScript”. This standard by ECMA organization
development and maintenance. ECMA-262 is the official JavaScript standard. This
standard based on JavaScript (Netscape) and JScript (Microsoft). Netscape (Navigator 2.0)
Brendan Eich has invented this language, started from 1996, already appeared in all
Netscape and in the Microsoft browser. The ECMA-262 development began in 1996, in
1997 July, the ECMA general meeting has accepted its first edition.
Script script uses one specific descriptive language, rests on certain form compilation
to be possible the execution document, is also called as great or the batch run document.
The script usually may transfer temporarily by the application procedure and carry out.
Each kind of script present widely is applied in the homepage design, because the script
not only may reduce the homepage the scale and raises the homepage browsing speed,
8
外文翻译--JSP及其WEB技术
moreover may enrich the homepage performance, like animation, sound and so on. Cites a
most common example, when we click in the homepage the E-mail address can transfer
Outlook Express or the Foxmail this kind of mail software automatically, is realizes
through the script function. Also because of script these characteristics, the human who
harbors ulterior motives by some are often using. For example joins some destruction
computer system's order in the script, like this works as the user browsing homepage, once
transfers this kind of script, will then cause the user the system to come under the attack.
Therefore the user should act according to visits homepage the trust degree selective
security rank, specially regarding these itself content on the illegal homepage, do not
permit the use script easily. Through “the safe establishment” the dialog box, the choice
“the script” under option each kind of establishment may with ease realize to script being
forbid and begins using.
Present's script language is quite many, script language execution generally only with
concrete explanation actuator related, so long as therefore on the system has the
corresponding language interpreter to be possible to achieve the cross platform. Script
(Script), is includes order and so on bind and alias sets, you may save this set are an
independent document then in the time which needs carries out, like this may facilitate you
in the CS use. The script may save for the suffix named .cfg document places under the
cstrike folder, when execution in control bench input: exec (script filename) .cfg then. For
instance saves a script is the document, inputs in the control bench:
may realize the function which we need. Must realize an order, so long as is good this
process definition (alias), and assigns a key position for this order, so long as later
according to will assign the good key position, may realize this proce
9
沈阳航空航天大学毕业设计(论文)外文翻译——译文
JSP及其WEB技术
. 1 JSP简介
JSP(JavaServer Pages)是一种基于Java的脚本技术。是由Sun Microsystems公司倡导、许多公司参与一起建立的一种动态网页技术标准。JSP技术有点类似ASP技术,它是在传统的网页HTML文件(*.htm,*.html)中插入Java程序段(Scriptlet)和JSP标记(tag),从而形成JSP文件(*.jsp)。用JSP开发的Web应用是跨平台的,即能在Linux下运行,也能在其他操作系统上运行。在JSP 的众多优点之中,其中之一是它能将 HTML 编码从 Web 页面的业务逻辑中有效地分离出来。用 JSP 访问可重用的组件,如 Servlet、JavaBean 和基于 Java 的 Web 应用程序。JSP 还支持在
Web 页面中直接嵌入 Java 代码。可用两种方法访问 JSP 文件:浏览器发送 JSP 文件请求、发送至 Servlet 的请求。JSP技术使用Java编程语言编写类XML的tags和scriptlets,来封装产生动态网页的处理逻辑。网页还能通过tags和scriptlets访问存在于服务端的资源的应用逻辑。JSP将网页逻辑与网页设计和显示分离,支持可重用的基于组件的设计,使基于Web的应用程序的开发变得迅速和容易。
Web服务器在遇到访问JSP网页的请求时,首先执行其中的程序段,然后将执行结果连同JSP文件中的HTML代码一起返回给客户。插入的Java程序段可以操作数据库、重新定向网页等,以实现建立动态网页所需要的功能。JSP与Java Servlet一样,是在服务器端执行的,通常返回该客户端的就是一个HTML文本,因此客户端只要有浏览器就能浏览。
JSP页面由HTML代码和嵌入其中的Java代码所组成。服务器在页面被客户端请求以后对这些Java代码进行处理,然后将生成的HTML页面返回给客户端的浏览器。Java Servlet 是JSP的技术基础,而且大型的Web应用程序的开发需要Java Servlet和JSP配合才能完成。JSP具备了Java技术的简单易用,完全的面向对象,具有平台无关性且安全可靠,主要面向因特网的所有特点。
2 JSP技术方法
为了快速方便地进行动态网站的开发,JSP在以下几个方面做了改进,使其成为快速建立跨平台的动态网站的首选方案。
1
沈阳航空航天大学毕业设计(论文)外文翻译——译文
2.1 将内容的生成和显示进行分离
用JSP技术,Web页面开发人员可以使用HTML或者XML标识来设计和格式化最终页面,并使用JSP标识或者小脚本来生成页面上的动态内容。生成内容的逻辑被封装在标识和JavaBeans组件中,并且捆绑在脚本中,所有的脚本在服务器端运行。由于核心逻辑被封装在标识和JavaBeans中,所以Web管理人员和页面设计者,能够编辑和使用JSP页面,而不影响内容的生成。在服务器端,JSP引擎解释JSP标识和脚本,生成所请求的内容,并且将结果以HTML(或者XML)页面的形式发送回浏览器。这既有助于作者保护自己的代码,又能保证任何基于HTML的Web浏览器的完全可用性。
2.2 可重用组件
绝大多数JSP页面依赖于可重用的、跨平台的组件(JavaBeans或者Enterprise
JavaBeans组件)来执行应用程序所要求的复杂的处理。开发人员能够共享和交换执行普通操作的组件,或者使得这些组件为更多的使用者和客户团体所使用。基于组件的方法加速了总体开发过程,并且使得各种组织在他们现有的技能和优化结果的开发努力中得到平衡。
2.3 采用标识
Web页面开发人员不会都是熟悉脚本语言的编程人员。JSP技术封装了许多功能,这些功能是在易用的、与JSP相关的XML标识中进行动态内容生成所需要的。标准的JSP标识能够访问和实例化JavaBeans组件,设置或者检索组件属性,下载Applet,以及执行用其他方法更难于编码和耗时的功能。
2.4 适应平台
几乎所有平台都支持Java,JSP+JavaBeans几乎可以在所有平台下通行无阻。从一个平台移植到另外一个平台,JSP和JavaBeans甚至不用重新编译,因为Java字节码都是标准的与平台无关的。
2.5 数据库连接
Java中连接数据库的技术是JDBC,Java程序通过JDBC驱动程序与数据库相连,
2
沈阳航空航天大学毕业设计(论文)外文翻译——译文
执行查询、提取数据等操作。Sun公司还开发了JDBC-ODBC bridge,利用此技术Java程序可以访问带有ODBC驱动程序的数据库,目前大多数数据库系统都带有ODBC驱动程序,所以Java程序能访问诸如Oracle、Sybase、MS SQL Server和MS Access等数据库。此外,通过开发标识库,JSP技术可以进一步扩展。第三方开发人员和其他人员可以为常用功能创建自己的标识库。这使得Web页面开发人员能够使用熟悉的工具和如同标识一样的执行特定功能的构件来进行工作。JSP技术很容易整合到多种应用体系结构中,以利用现存的工具和技巧,并且能扩展到支持企业级的分布式应用中。
3 Eclipse功能简介
越来越多的Java开发人员已经开始欣赏Eclipse的JDT提供的生产率和质量收益。它为Java编辑器提供了语法高亮显示、格式化、折叠、内容辅助、代码模板等许多功能。它不断增长的可用重构和代码生成功能集合允许您在更高的级别上操作代码,并自动化通常的代码密集型任务和易错任务。而且,在开发完代码并使用JDT对编写和执行JUnit测试的内置支持对代码进行单元测试之后,可以使用Eclipse的一流Java调试器调试在运行时遇到的任何问题。除了JDT之外,Eclipse SDK—最流行的下载—还包含Plug-in Development Environment(PDE)。PDE使用特定功能扩展了JDT以构建Eclipse插件—基于Eclipse的应用程序的基本构造块。事实上,使用由Eclipse本身提供的工具能够超越Java开发,可扩展现有Eclipse应用程序,或者甚至创建全新的应用程序。
Eclipse由一个小程序层构成,其中包含许多功能模块或Eclipse术语中所谓的“插件”。插件是在Eclipse应用程序中提供所有功能的组件。它们通过其API一起协作来交付最终结果。在Eclipse中,甚至最基础的功能,比如查找和启动安装的插件,都封装在插件中。为了扩展现有Eclipse功能或在其上进行构建,插件将具体的扩展贡献给由其他插件暴露的扩展点。通常,插件专注于特定区域的责任,并通过一个或多个扩展点的方式将其他责任指派给其他插件。例如,一个插件允许您可视地并行比较两个文件的内容,但它不会关心如何读取这些文件甚至如何解释这些文件的结构;这是其他插件的工作。比较两个文件时,该插件首先检查是否有另一个插件可以解释这些文件的结构。如果找到一个,它就会向找到的插件询问有关文件结构的信息,并在比较过程中使用该信息。
3
沈阳航空航天大学毕业设计(论文)外文翻译——译文
可以看到,模块化架构为Eclipse提供了巨大的灵活性,并提供了一个可以支持原设计者没有预料到的大量应用程序的平台。
4 Structs功能简介
Struts是一个MVC框架(Framework),用于快速开发Java Web应用。Struts实现的重点在C(Controller),包括ActionServlet/RequestProcessor和我们定制的Action,也为V(View)提供了一系列定制标签(Custom Tag)。Spring是一个轻型容器(light-weight container),其核心是Bean工厂(Bean Factory),用以构造我们所需要的M(Model)。在此基础之上,Spring提供了AOP(Aspect-Oriented
Programming, 面向层面的编程)的实现,用它来提供非管理环境下申明方式的事务、安全等服务;对Bean工厂的扩展ApplicationContext更加方便我们实现J2EE的应用;DAO/ORM的实现方便我们进行数据库的开发;Web MVC和Spring Web提供了Java
Web应用的框架或与其他流行的Web框架进行集成。就是说可将两者一起使用,达到将两者自身的特点进行互补。
Structs 是一组相互协作的类、servlet 和 JSP 标记,它们组成一个可重用的
MVC 2 设计。这个定义表示 Struts 是一个框架,而不是一个库,但 Struts 也包含了丰富的标记库和独立于该框架工作的实用程序类。
Client browser(客户浏览器),来自客户浏览器的每个 HTTP 请求创建一个事件。Web 容器将用一个 HTTP 响应作出响应。
Controller(控制器),控制器接收来自浏览器的请求,并决定将这个请求发往何处。就 Struts 而言,控制器是以 servlet 实现的一个命令设计模式。
文件配置控制器。
业务逻辑,业务逻辑更新模型的状态,并帮助控制应用程序的流程。就 Struts 而言,这是通过作为实际业务逻辑“瘦”包装的 Action 类完成的。
Model(模型)的状态,模型表示应用程序的状态。业务对象更新应用程序的状态。ActionForm bean 在会话级或请求级表示模型的状态,而不是在持久级。JSP 文件使用 JSP 标记读取来自 ActionForm bean 的信息。
View(视图),视图就是一个 JSP 文件。其中没有流程逻辑,没有业务逻辑,也没有模型信息 -- 只有标记。标记是使 Struts 有别于其他框架(如 Velocity)的
4
沈阳航空航天大学毕业设计(论文)外文翻译——译文
因素之一。
Struts 的控制器是将事件(事件通常是 HTTP post)映射到类的一个 servlet.正如您所料 —— 控制器使用配置文件以使您不必对这些值进行硬编码。时代变了,但方法依旧。
Action类,ActionForm 维护 Web 应用程序的会话状态。 ActionForm 是一个抽象类,必须为每个输入表单模型创建该类的子类。当我说 输入表单模型 时,是指
ActionForm 表示的是由 HTML 表单设置或更新的一般意义上的数据。Action类是业务逻辑的一个包装。 Action 类的用途是将 HttpServletRequest 转换为业务逻辑。要使用 Action ,请创建它的子类并覆盖 process() 方法。
ActionServlet (Command) 使用 perform() 方法将参数化的类传递给
ActionForm .仍然没有太多讨厌的 ameter() 调用。当事件进展到这一步时,输入表单数据(或 HTML 表单数据)已被从请求流中提取出来并转移到
ActionForm 类中。
考虑 Action 类的另一种方式是 Adapter 设计模式。 Action 的用途是“将类的接口转换为客户机所需的另一个接口。Adapter 使类能够协同工作,如果没有
Adapter,则这些类会因为不兼容的接口而无法协同工作。”。本例中的客户机是
ActionServlet ,它对我们的具体业务类接口一无所知。因此,Struts 提供了它能够理解的一个业务接口,即 Action .通过扩展 Action ,我们使得我们的业务接口与 Struts 业务接口保持兼容。
5 CSS简介
CSS的编辑方法同HTML一样,也可以是任何文本编辑器或网页编辑软件,还有专门用来编辑CSS的软件。 如果你写的CSS语句是当成外部样式表而在HTML文件中调用,那它的扩展名存成.css就可。当初技术人员想出HTML,主要侧重于定义内容,比如 p表示一个段落,h1表示标题,而并没有过多设计HTML的排版和界面效果。
随着Internet的迅猛发展,HTML被广泛应用,上网的人们当然希望网页做得漂亮些,因此HTML排版和界面效果的局限性日益暴露出来。为了解决这个问题,人们也走了不少弯路,用了一些不好的方法,比如给HTML增加很多的属性结果将代码变得很臃肿,将文本变成图片,过多利用Table来排版,用空白的图片表示白色的空间
5
沈阳航空航天大学毕业设计(论文)外文翻译——译文
等。直到CSS出现。
CSS可算是网页设计的一个突破,它解决了网页界面排版的难题。可以这么说,HTML的Tag主要是定义网页的内容(Content),而CSS决定这些网页内容如何显示(Layout)。CSS的英文是Cascading Style Sheets,中文可以翻译成串联式样式表。CSS按其位置可以分成三种:内嵌样式(Inline Style) ,内部样式表(Internal Style
Sheet) ,外部样式表(External Style Sheet)。
6 HTML功能简介
Hyper Text Markup Language 超文本标记语言是一种用来制作超文本文档的简单标记语言。用HTML编写的超文本文档称为HTML文档,它能独立于各种操作系统平台(如UNIX,WINDOWS等)。自1990年以来HTML就一直被用作World Wide Web上的信息表示语言,用于描述Homepage的格式设计和它与WWW上其它Homepage的连结信息。
HTML文档(即Homepage的源文件)是一个放置了标记的ASCII文本文件,通常它带有.html或.htm的文件扩展名。生成一个HTML文档主要有以下三种途径:1.手工直接编写(例如用你所喜爱的ASCII文本编辑器或其它HTML的编辑工具)。2.通过某些格式转换工具将现有的其它格式文档(如WORD文档)转换成HTML文档。3.由Web服务器(或称HTTP 服务器)一方实时动态地生成。
HTML语言是通过利用各种标记(tags)来标识文档的结构以及标识超链(Hyperlink)的信息。
虽然HTML语言描述了文档的结构格式,但并不能精确地定义文档信息必须如何显示和排列,而只是建议Web浏览器(如Mosiac,Netscape等)应该如何显示和排列这些信息,最终在用户面前的显示结果取决于Web浏览器本身的显示风格及其对标记的解释能力。这就是为什么同一文档在不同的浏览器中展示的效果会不一样。目前HTML语言的版本是2.0,它是基于SGML(Standard Generalized Markup Language,标准广义置标语言,是一套用来描述数字化文档的结构并管理其内容的复杂的规范)中的一个子集演变而来的。虽然下一版本的标准HTML3.0(也称为HTML+)正在制订之中,但其中某些部分的实验性标准草案已被广泛采用,大多优秀的Web浏览器(如Netscape等)都能解释HTML3.0中的部分新标记,因此在本章中介绍的一些HTML3.0
6
沈阳航空航天大学毕业设计(论文)外文翻译——译文
新标记均已被多数浏览器所接受。
7 Js脚本语言简介
JS即javascrip,Javascript是一种由Netscape的LiveScript发展而来的脚本语言,主要目的是为了解决服务器终端语言,比如Perl,遗留的速度问题。当时服务端需要对数据进行验证,由于网络速度相当缓慢,只有28.8kbps,验证步骤浪费的时间太多。于是Netscape的浏览器Navigator加入了Javascript,提供了数据验证的基本功能。
JavaScript 的正式名称是 "ECMAScript"。这个标准由 ECMA 组织发展和维护。ECMA-262 是正式的 JavaScript 标准。这个标准基于 JavaScript (Netscape) 和
JScript (Microsoft)。Netscape (Navigator 2.0) 的 Brendan Eich 发明了这门语言,从 1996 年开始,已经出现在所有的 Netscape 和 Microsoft 浏览器中。ECMA-262 的开发始于 1996 年,在 1997 年 7 月,ECMA 会员大会采纳了它的首个版本。
脚本script是使用一种特定的描述性语言,依据一定的格式编写的可执行文件,又称作宏或批处理文件。脚本通常可以由应用程序临时调用并执行。各类脚本目前被广泛地应用于网页设计中,因为脚本不仅可以减小网页的规模和提高网页浏览速度,而且可以丰富网页的表现,如动画、声音等。举个最常见的例子,当我们点击网页上的E-mail地址时能自动调用Outlook Express或Foxmail这类邮件软件,就是通过脚本功能来实现的。也正因为脚本的这些特点,往往被一些别有用心的人所利用。例如在脚本中加入一些破坏计算机系统的命令,这样当用户浏览网页时,一旦调用这类脚本,便会使用户的系统受到攻击。所以用户应根据对所访问网页的信任程度选择安全等级,特别是对于那些本身内容就非法的网页,更不要轻易允许使用脚本。通过“安全设置”对话框,选择“脚本”选项下的各种设置就可以轻松实现对脚本的禁用和启用。
现在的脚本语言是比较多的,一般的脚本语言的执行只同具体的解释执行器有关,所以只要系统上有相应语言的解释程序就可以做到跨平台。脚本(Script),就是含有bind和alias等命令的集合,你可以把这个集合存为一个独立的文件然后在需要的时候执行,这样就可以方便你在CS中的使用。脚本可以存为后缀名为.cfg的文
7
沈阳航空航天大学毕业设计(论文)外文翻译——译文
件放在cstrike文件夹下,执行时在控制台输入:exec(脚本文件名).cfg即可。比如将一个脚本存为 文件,则在控制台中输入:则可以实现我们所需要的功能。要实现一个命令只要把这一过程定义(alias)好,并且分配一个键位给这个命令,以后只要按分配好的键位,就可以实现这一过程。所有的脚本都是通过这一方法实现的。
忽略此处..
8
本文发布于:2024-02-03 21:17:30,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170696625051325.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |