图片 2

Part II 3.从Web应用开始(Getting Started with Web Applications)

JAVASERVER PAGESTM NEWS & ARTICLES

Certain aspects of web application behavior can be configured when the
application is installed, or **deployed**, to the web container. The
configuration information can be specified using Java EE annotations or
can be maintained in a text file in XML format called a web application
deployment descriptor (DD). A web application DD must conform to the
schema described in the Java Servlet specification.

jsp是后端才具,html5和js,css是前面一个技能,可以比之处相当的小,要是硬要对照的话,确实jsp在产出了超级多mvc框架后,jsp只当作v层的剧中人物也稳步被诸如freemarker,velocity等技术在运作功能,特别和前端职员的可读性方面落入了下峰,jstl标签技能也只是弥补那地点的供应满足不了须要,但质量方面真正不敢恭维。

SERVLETS TAVERNE

object. The web server converts this object to an HTTP response and
returns it to the client.

JSP :

JavaServer Pages (JSP) is a technology for developing web pages that
support dynamic content which helps developers insert java code in HTML
pages by making use of special JSP tags, most of which start with <%
and end with %>. A JavaServer Pages component is a type of Java
servlet that is designed to fulfill the role of a user interface for a
Java web application. Web developers write JSPs as text files that
combine HTML or XHTML code, XML elements, and embedded JSP actions and
commands. Using JSP, you can collect input from users through web page
forms, present records from a database or another source, and create web
pages dynamically.

Main features:

  • Performance is significantly better because JSP allows embedding
    Dynamic Elements in HTML Pages itself instead of having a separate
    CGI files.
  • JSP are always compiled before it’s processed by the server unlike
    CGI/Perl which requires the server to load an interpreter and the
    target script each time the page is requested.
  • JavaServer Pages are built on top of the Java Servlets API, so like
    Servlets, JSP also has access to all the powerful Enterprise Java
    APIs, including JDBC, JNDI, EJB, JAXP etc.
  • JSP pages can be used in combination with servlets that handle the
    business logic, the model supported by Java servlet template
    engines.

servlets.com

Web应用程序的少数方面作为可以在应用程序安装恐怕安顿到Web容器的时候配置。配置音信能够用Java
EE 注脚来钦定,恐怕被保养在七个被誉为Web应用程序陈设描述(Deployment
Descriptor,DD)的XML格式的文件文件。贰个Web应用程序安顿描述必得信守Java
Servlet Specification中描述的形式。

你借使选别的框架,可以不学JSP,起码要学Servlet,那是独具框架的幼功。

JSP其余有关能源:

图片 1

JAVASCRIPT :

Javascript is a dynamic computer programming language. It is lightweight
and most commonly used as a part of web pages, whose implementations
allow client-side script to interact with the user and make dynamic
pages. It is an interpreted programming language with object-oriented
capabilities.

Main features:

  • JavaScript is a lightweight, interpreted programming language.
  • Designed for creating network-centric applications.
  • Complementary to and integrated with Java.
  • Complementary to and integrated with HTML.
  • Open and cross-platform

JavaServer PagesTM: A Developer’s Perspective

Servlets are Java programming language classes that dynamically process
requests and construct responses. Java technologies, such as JavaServer
Faces and Facelets, are used for building interactive web applications.
(Frameworks can also be used for this purpose.) Although servlets and
Java Server Faces and Facelets pages can be used to accomplish similar
things, each has its own strengths. Servlets are best suited for
service-oriented applications (web service endpoints can be implemented
as servlets) and the control functions of a presentation-oriented
application, such as dispatching requests and handling nontextual data.
Java Server Faces and Facelets pages are more appropriate for generating
text-based markup, such as XHTML, and are generally used for
presentation–oriented applications.

SERVLETS :

Java Servlets are programs that run on a Web or Application server and
act as a middle layer between a request coming from a Web browser or
other HTTP client and databases or applications on the HTTP server.
Using Servlets, you can collect input from users through web page forms,
present records from a database or another source, and create web pages
dynamically.

Main features:

  • Servlets execute within the address space of a Web server. It is not
    necessary to create a separate process to handle each client
    request.
  • Servlets are platform-independent because they are written in Java.
  • Java security manager on the server enforces a set of restrictions
    to protect the resources on a server machine. So servlets are
    trusted.
  • The full functionality of the Java class libraries is available to a
    servlet. It can communicate with applets, databases, or other
    software via the sockets and RMI mechanisms that you have seen
    already.

JAVASERVER PAGESTM TECHNICAL RESOURCES

Web components are supported by the services of a runtime platform
called a **web container**. A web container provides such services
as request dispatching, security, concurrency, and lifecycle management.
A web container also gives web components access to such APIs as naming,
transactions, and email.

Servlets and JavaServer Pages (JSP) 1.0: A Tutorial

This chapter gives a brief overview of the activities involved in
developing web applications. First, it summarizes the web application
lifecycle and explains how to package and deploy very simple web
applications on the GlassFish Server. The chapter moves on to
configuring web applications and discusses how to specify the most
commonly used configuration parameters.

在Java
EE平台中,**Web组件**为Web服务器提供动态扩大的本领。Web组件可以是Java
Servlet,JavaServer
Faces本领完结的Web页面,Web服务端点,恐怕JSP页面。图3-1表明了动用Servlet的Web服务器和Web应用之间的并行。客商端发送叁个HTTP要求给Web服务器。三个完结了Java
Servlet和JavaServer
Page(译注:简单称谓JSP,JSP也正是服务器拆解深入分析JSP语言动态变化网页的本事)才干的Web服务器把乞求转变到一个HTTPServletRequest对象。这些目的被传送到八个Web组件中,Web组件能够与JavaBeans组件或许三个数据库调换,来变化动态内容。这几个Web组件然后就会生成一个HTTPServletResponse大概把央求传递到另贰个Web组件。一个Web组件最后生成多个HTTPServletResponse对象。Web服务器把那么些指标转变到二个HTTP响应然后把它回到给顾客端。

Web组件由被称作Web容器的运行时平台支撑。三个Web容器以分配、安全、并发和生命周期管理的款式提供那么些劳动。一个Web容器也为Web组件提供了如命名、transation和email等API访谈。

Web应用

or can pass the request to another web component. A web component
eventually generates a HTTPServletResponse

Servlet是Java编制程序语言类,动态地管理乞请以致创设响应。诸如JavaServer
Faces和Facelets的Java工夫,被用来营造立外交关系互式Web应用程序(框架也能够用作此指标)。就算Servlet、Java
Server
Faces和Facelets页面能够用来成功接近的事体,可是她们各有帮助和益处。Servlets最适于面向服务的应用程序(Web服务端点能够兑现为Servlet)以致面向展现的应用程序的支配部分,举例分发需要和拍卖非文本数据。Java
Server Faces 和 Facelet
页面更符合于生成基于文本的标识语言,比如XHTML,况且更广大地选用与面向浮现的应用程序。

那生机勃勃节给出了支出Web应用程序包罗的活动的大致综述。首先,它总结了Web应用程序生命周期,解释了怎么打包和在GlassFish服务器布置特别轻巧的Web应用程序。该节会延续助教配置Web应用程序,斟酌如何拟订最常用的安插参数。

Figure 3-1 Java Web Application Request Handling

Web Applications

In the Java EE platform, **web components** provide the dynamic
extension capabilities for a web server. Web components can be Java
servlets, web pages implemented with JavaServer Faces technology, web
service endpoints, or JSP
pages. [Figure 3-1](
the interaction between a web client and a web application that uses a
servlet. The client sends an HTTP request to the web server. A web
server that implements Java Servlet and JavaServer Pages technology
converts the request into an HTTPServletRequest

object. This object is delivered to a web component, which can interact
with JavaBeans components or a database to generate dynamic content. The
web component can then generate an HTTPServletResponse

图片 2

图3-1 Java Web服务器哀告处理

发表评论

电子邮件地址不会被公开。 必填项已用*标注