- 浏览: 254834 次
- 性别:
- 来自: 南京
文章分类
最新评论
-
mabusyao:
漠北空城 写道请问下,你这个是JDK版本是多少呢?!忘记了,应 ...
HashMap 源码解读 -
漠北空城:
请问下,你这个是JDK版本是多少呢?!
HashMap 源码解读 -
schumee:
完美团队~
项目沉思录 - 1.1 -
winie:
整理下 搞成引擎嘛 国产需要这样的engine
简单工作流引擎 -
mabusyao:
某位同学给我提供的堪称完美的解决方案:1. 将三个int数组放 ...
CraneWork
1 Servlet Overview
This chapter contains the following sections:
Note: Sample servlet ap plications are included in the OC4J demos, available from the following location on the Oracle Technology Network (requiring an OTN membership, which is free of charge):
|
Introduction to Servlets
The following sections offer a brief introduction to servlet technology:
The terms Web module and Web application are interchangeable in most uses and are both used throughout this document. If there is a distinction, it is that "Web module" typically indicates a single component, whether or not it composes an independent application, while "Web application" typically indicates a working application that may consist of multiple modules or components. |
Review of Servlet Technology
In recent years, servlet technology has emerged as a powerful way to extend Web server functionality through dynamic Web pages. A servlet is a Java program that runs in a Web server, as opposed to an applet that runs in a client browser. Typically, the servlet takes an HTTP request from a browser, generates dynamic content (such as by querying a database), and provides an HTTP response back to the browser. Alternatively, the servlet can be accessed directly from another application component or send its output to another component. Most servlets generate HTML text, but a servlet may instead generate XML to encapsulate data.
More specifically, a servlet runs in a J2EE application server, such as OC4J. Servlets are one of the main application component types of a J2EE application, along with JavaServer Pages (JSP) and EJB modules, which are also server-side J2EE component types. These are used in conjunction with client-side components such as applets (part of the Java 2 Platform, Standard Edition specification) and application client programs. An application may consist of any number of any of these components.
Prior to servlets, Common Gateway Interface (CGI) technology was used for dynamic content, with CGI programs being written in languages such as Perl and being called by a Web application through the Web server. CGI ultimately proved less than ideal, however, due to its architecture and scalability limitations.
Advantages of Servlets
In the Java realm, servlet technology offers advantages over applet technology for server-intensive applications, such as those accessing a database. One advantage of running in the server is that the server is usually a robust machine with many resources, making the program more scalable. Running in the server also results in more direct access to the data. The Web server in which a servlet is running is on the same side of the network firewall as the data being accessed.
Servlet programming also offers advantages over earlier models of server-side Web application development, including the following:
-
Servlets outperform earlier technologies for generating dynamic HTML, such as server-side "includes" or CGI scripts. After a servlet is loaded into memory, it can run on a single lightweight thread; CGI scripts must be loaded in a different process for every request.
-
Servlet technology, in addition to improved scalability, offers the well-known Java advantages of security, robustness, object orientation, and platform independence.
-
Servlets are fully integrated with the Java language and its standard APIs, such as JDBC for Java database connectivity.
-
Serv lets are fully integrated into the J2EE framework, which provides an extensive set of services that your Web application can use, such as Java Naming and Directory Interface (JNDI) for component naming and lookup, Java Transaction API (JTA) for managing transactions, Java Authentication and Authorization Service (JAAS) for security, Remote Method Invocation (RMI) for distributed applications, and Java Message Service (JMS). The following Web site contains information about the J2EE framework and services:
http://java.sun.com/j2ee/docs.html
-
A servlet handles concurrent requests (through either a single servlet instance or multiple servlet instances, depending on the thread model), and servlets have a well-defined lifecycle. In addition, servlets can optionally be loaded when OC4J starts, so that any initialization is handled in advance instead of at the first user request. See "Servlet Preloading" .
-
The servlet request and response objects offer a convenient way to handle HTTP requests and send text and data back to the client.
Because servlets are written in the Java programming language, they are supported on any platform that has a Java virtual machine (JVM) and a Web server that supports servlets. Servlets can be used on different platforms without recompiling. You can package servlets together with associated files such as graphics, sounds, and other data to make a complete Web application. This simplifies application development and deployment.
In addition, you can port a servlet-based application from another Web server to OC4J with little effort. If your application was developed for a J2EE-compliant Web server, then the porting effort is minimal.
The Ser vlet Interface and Request and Response Objects
A Java servlet, by definition, implements the javax.servlet.Servlet
interface. This interface specifies methods to initialize a servlet,
process requests, get the configuration and other basic information of a
servlet, and terminate a servlet instance.
For Web applications, you can implement the Servlet
interface by extending the javax.servlet.http.HttpServlet
abstract class. (Alternatively, for protocol-independent servlets, you
can extend the javax.servlet.GenericServlet
class.) The HttpServlet
class includes the following methods:
-
init(...)
: Initialize the servlet. -
destroy(...)
: Terminate the servlet. -
doGet(...)
: Execute an HTTPGET
request. -
doPost(...)
: Execute an HTTPPOST
request. -
doPut(...)
: Execute an HTTPPUT
request. -
doDelete(...)
: Execute an HTTPDELETE
request. -
service(...)
: Receive HTTP requests and, by default, dispatch them to the appropriatedo
XXX
()
methods. -
getServletInfo(...)
: Retrieve information about the servlet.
A servlet class that extends HttpServlet
implements some
or all of these methods, as appropriate, overriding the original
implementations as necessary to process the request and return the
response as desired. For example, most servlets override the doGet()
method, doPost()
method, or both to process HTTP GET
and POST
requests.
Each method takes as input an HttpServletRequest
instance (an instance of a class that implements the javax.servlet.http.HttpServletRequest
interface) and an HttpServletResponse
instance (an
instance of a class that implements the javax.servlet.http.HttpServletResponse
interface).
The HttpServletRequest
instance provides information to
the servlet regarding the HTTP request, such as request parameter names
and values, the name of the remote host that made the request, and the
name of the server that received the request. The HttpServletResponse
instance provides HTTP-specific functionality in sending the response,
such as specifying the content length and MIME type and providing the
output stream.
Servlets and the Ser vlet Container
Unlike a Java client program, a servlet has no static main()
method. Therefore, a servlet must execute under the control of an
external container.
Servlet containers , sometimes referred to as servlet engines , execute and manage servlets. The servlet container calls servlet methods and provides services that the servlet needs while executing. A servlet container is usually written in Java and is either part of a Web server (if the Web server is also written in Java) or is otherwise associated with and used by a Web server. OC4J includes a fully standards-compliant servlet container.
The servlet container provides the servlet with easy access to properties of the HTTP request, such as its headers and parameters. When a servlet is called, such as when it is specified by URL, the Web server passes the HTTP request to the servlet container. The container, in turn, passes the request to the servlet. In the course of managing a servlet, a servlet container performs the following tasks:
-
It creates an instance of the servlet and calls its
init()
method to initialize it. -
It constructs a request object to pass to the servlet. The request includes, among other things:
-
Any HTTP headers from the client
-
Parameters and values passed from the client (for example, names and values of query strings in the URL)
-
The complete URI of the servlet request
-
-
It constructs a response object for the servlet.
-
It invokes the servlet
service()
method. Note that for HTTP servlets, the generic service method is usually overridden in theHttpServlet
class. The service method dispatches requests to the servletdoGet()
ordoPost()
methods, depending on the HTTP header in the request (GET
orPOST
). -
It calls the
destroy()
method of the servlet to discard it, when appropriate, so that it can be garbage collected. (For performance reasons, it is typical for a servlet container to keep a servlet instance in memory for reuse, rather than destroying it each time it has finished its task. It would be destroyed only for infrequent events, such as Web server shutdown.)
Figure
1-1
shows how a servlet relates to the servlet container and to a
client, such as a Web browser. When the Web listener is the Oracle HTTP
Server (powered by Apache), the connection to the OC4J servlet container
goes through the mo
d_oc4j
module. See the Oracle
HTTP Server Administrator's Guide
for details.
Figure 1-1 Servlets and the Servlet Container
Description of "Figure 1-1 Servlets and the Servlet Container"
Introduction to Serv let Sessions
Servlets use HTTP sessions to keep track of which user each HTTP request comes from, so that a group of requests from a single user can be managed in a stateful way. Servlet session tracking is similar in nature to session tracking in previous technologies, such as CGI.
This section provides an introduction to servlet sessions. See "Servlet Sessions" for more information and examples.
Introduction to Ses sion Tracking
Servlets provide convenient ways to keep the client and a server session in synchronization, enabling stateful servlets to maintain session state on the server over the whole duration of a client browsing session.
OC4J supports the following session-tracking mechanisms. See "Session Tracking" for more information.
-
The servlet container sends a cookie to the client, which returns the cookie to the server upon each HTTP request. This process associates the request with the session ID indicated by the cookie. This is the most frequently used mechanism and is supported by any servlet container that adheres to the servlet specification.
-
Instead of using cookies, the servlet can call the
encodeURL()
method of the response object, or theencodeRedirectURL()
method for redirects, to append a session ID to the URL path for each request. This process allows the request to be associated with the session. This is the most frequently used mechanism for situations in which clients do not accept cookies.
Introduction to the HttpSes sion Interface
In the standard servlet API, each client session is represented by an
instance of a class that implements the javax.servlet.http.HttpSession
interface. Servlets can set and get information about the session in
this HttpSession
object, which must be of application-level
scope.
A servlet uses the getSession()
method of an HttpServletRequest
object to retrieve or create an HttpSession
object for the
user. This method takes a boolean argument to specify whether a new
session object should be created for the client if one does not already
exist within the application.
See "Features of the HttpSession Interface" for more information.
Introduction to Ser vlet Contexts
A servlet context is used to maintain information for all instances of a Web application within any single JVM (that is, for all servlet and JSP page instances that are part of the Web application). There is one servlet context for each Web application running within a given JVM; this is always a one-to-one correspondence. You can think of a servlet context as a container for a specific application.
Servlet Context Basics
Any servlet context is an instance of a class that implements the javax.servlet.ServletContext
interface, with such a class being provided with any Web server that
supports servlets.
A ServletContext
object provides information about the
servlet environment (such as name of the server) and allows sharing of
resources between servlets in the group, within any single JVM. (For
servlet containers supporting multiple simultaneous JVMs, implementation
of resource-sharing varies.)
A servlet context provides the scope for the running instances of the
application. Through this mechanism, each application is loaded from a
distinct classloader and its runtime objects are distinct from those of
any other application. In particular, the ServletContext
object is distinct for an application, much as each HttpSession
object is distinct for each user of the application.
Beginning with version 2.2 of the servlet specification, most implementations can provide multiple servlet contexts within a single host, which is what allows each Web application to have its own servlet context. (Previous implementations usually provided only a single servlet context with any given host.)
How to Obtain a Servlet Context
Use the getServletContext()
method of a servlet
configuration object to retrieve a servlet context. See "Introduction
to Servlet Configuration Objects"
.
Servlet Context Methods
The ServletContext
interface specifies methods that
allow a servlet to communicate with the servlet container that runs it,
which is one of the ways that the servlet can retrieve application-level
environment and state information. Methods specified in ServletContext
include those listed here. For complete information, refer to the Sun
Microsystems Javadoc at the following location:
http://java.sun.com/products/servlet/2.3/javadoc/index.html
-
void setAttribute(String name, Object value)
This method binds the specified object to the specified attribute name in the servlet context. Using attributes, a servlet container can give information to the servlet that is not otherwise provided through the
ServletContext
interface.Note :
For a servlet context,setAttribute()
is a local operation only. It is not intended to be distributed to other JVMs within a cluster. (This is in accordance with the servlet specification.)
-
Object getAttribute(String name)
This method returns the attribute with the given name, or
null
if there is no attribute by that name. The attribute is returned as ajava.lang.Object
instance. -
java.util.Enumeration getAttributeNames()
This method returns a
java.util.Enumeration
instance containing the names of all available attributes of the servlet context. -
void removeAttribute(String attrname)
This method removes the specified attribute from the servlet context.
-
String getInitParameter(String name)
This method returns a string that indicates the value of the specified context-wide initialization parameter, or
null
if there is no parameter by that name. This allows access to configuration information that is useful to the Web application associated with this servlet context. -
Enumeration getInitParameterNames()
This method returns a
java.util.Enumeration
instance containing the names of the initialization parameters of the servlet context. -
RequestDispatcher getNamedDispatcher(String name)
This method returns a
javax.servlet.RequestDispatcher
instance that acts as a wrapper for the specified servlet. -
RequestDispatcher getRequestDispatcher(String path)
This method returns a
javax.servlet.RequestDispatcher
instance that acts as a wrapper for the resource located at the specified path. -
String getRealPath(String path)
This method returns the real path, as a string, for the specified virtual path.
-
URL getResource(String path)
This method returns a
java.net.URL
instance with a URL to the resource that is mapped to the specified path. -
String getServerInfo()
This method returns the name and version of the servlet container.
-
String getServletContextName()
This method returns the name of the Web application with which the servlet context is associated, according to the
<display-name>
element of theweb.xml
file.
Introduction to Ser vlet Configuration Objects
A servlet configuration object
contains
initialization and startup parameters for a servlet and is an instance
of a class that implements the javax.servlet.ServletConfig
interface. Such a class is provided with any J2EE-compliant Web server.
You can retrieve a servlet configuration object for a servlet by
calling the getServletConfig()
method of the servlet. This
method is specified in the javax.servlet.Servlet
interface,
with a default implementation in the javax.servlet.http.HttpServlet
class.
The ServletConfig
interface specifies the following
methods:
-
ServletContext getServletContext()
Retrieve a servlet context for the application. See "Introduction to Servlet Contexts" .
-
String getServletName()
Retrieve the name of the servlet.
-
Enumeration getInitParameterNames()
Retrieve the names of the initialization parameters of the servlet, if any. The names are returned in a
java.util.Enumeration
instance ofString
objects. (TheEnumeration
instance is empty if there are no initialization parameters.) -
String getInitParameter(String name)
This returns a
String
object containing the value of the specified initialization parameter, ornull
if there is no parameter by that name.
Introduction to Servlet Filt ers
Request objects (instances of a class that implements HttpServletRequest
)
and response objects (instances of a class that implements HttpServletResponse
)
are typically passed directly between the servlet container and a
servlet.
The servlet specification, however, allows servlet filters , which are Java programs that execute on the server and can be interposed between the servlet (or group of servlets) and the servlet container for special request or response processing.
If there is a filter or a chain of filters to be invoked before the
servlet, these are called by the container with the request and response
objects as parameters. The filters pass these objects, perhaps
modified, or alternatively create and pass new objects, to the next
object in the chain using the doChain()
method.
See "Servlet Filters" for more information.
Introduction to Ev ent Listeners
The servlet specification adds the capability to track key events in your Web applications through event listeners . This functionality allows more efficient resource management and automated processing based on event status.
When creating listener classes, you can implement standard interfaces for servlet context lifecycle events, servlet context attribute changes, HTTP session lifecycle events, and HTTP session attribute changes. A listener class can implement one, some, or all of the interfaces as appropriate.
An event listener class is declared in the web.xml
deployment descriptor and invoked and registered upon application
startup. When an event occurs, the servlet container calls the
appropriate listener method.
See "Event Listeners" for more information.
JSP Pages and Other J2EE Component Types
In addition to servlets, an application may include other server-side components, such as JSP pages and EJBs. It is especially common for servlets to be used in combination with JSP pages in a Web application. Servlets are managed by the OC4J servlet container; EJBs are managed by the OC4J EJB container; and JSP pages are managed by the OC4J JSP container. These containers form the core of OC4J.
JSP pages also involve the servlet container, because the JSP container itself is a servlet and is therefore executed by the servlet container. The JSP container translates JSP pages into page implementation classes, which are executed by the JSP container and are also essentially servlets.
Note: Wherever this manual mentions functionality that applies to servlets, you can assume it applies to JSP pages as well unless stated otherwise. |
For more information about JSP pages and EJBs, see the following:
<!-- class="sect1" -->
A First Se rvlet Example
Looking at a basic example is the best way to demonstrate the general framework for writing a servlet.
Hello World Code
This servlet prints "Hi There!" back to the client. The comments note some of the basic aspects of writing a servlet.
// You must import at least the following packages for any servlet you write. import java.io.*; import javax.servlet.*; import javax.servlet.http.*; // Extend HttpServlet, the base servlet implementation. public class HelloServlet extends HttpServlet { // Override the base implementation of doGet(), as desired. public void doGet (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { // Set the MIME type for the response content. resp.setContentType("text/html"); // Get an output stream to use in sending the output to the client. ServletOutputStream out = resp.getOutputStream(); // Put together the HTML code for the output. out.println("<html>"); out.println("<head><title>Hello World</title></head>"); out.println("<body>"); out.println("<h1>Hi There!</h1>"); out.println("</body></html>"); } }
<!-- class="sect2" -->
Compiling and Deploying the Servlet
To try out the sample servlet code in an OC4J standalone environment,
save it as HelloServlet.java
in the /WEB-INF/classes
directory of the OC4J default Web application. (See "OC4J
Default Application and Default Web Application"
.)
Next, compile the servlet. First verify that servlet.jar
,
supplied with OC4J, is in your classpath. This contains the Sun
Microsystems javax.servlet
and javax.servlet.http
packages.
Note: For convenience during development and testing, use the OC4J auto-compile feature for servlet code. This is enabled through the settingdevelopment="true"
in the <orion-web-app>
element of the global-web-application.xml
file in the OC4J
configuration files directory. The source-directory
attribute may also have to be set appropriately. With auto-compile
enabled, after you change the servlet source and save it in the
appropriate directory, the OC4J server automatically compiles and
redeploys the servlet the next time it is invoked.
See "Element
Descriptions for global-web-application.xml and orion-web.xml"
for
more information about |
<!-- class="sect2" -->
Running the Servlet
Assuming that the OC4J server is up and running and that invocation
by class name is enabled with the servlet-webdir
built-in
default setting of "/servlet/
", you can invoke the servlet
and see its output from a Web browser as follows, where host
is the name of the host that
the OC4J server is running on and port
is the Web listener port:
http://host :port /servlet/HelloServlet
(See "Servlet
Invocation by Class Name During OC4J Development"
for information
about invocation by class name and about the OC4J servlet-webdir
attribute.)
In an OC4J standalone environment, use port 8888 to access the OC4J Web listener directly. (See "OC4J Standalone for Development" for an overview.)
This example assumes that "/
" is the context path of the
Web application, as is true by default in OC4J standalone for the
default Web application.
发表评论
-
各种语言写的wordcount
2015-09-24 16:07 0Java版本: String input ... -
数组双指针算法的研究
2015-07-14 16:59 2469双指针算法在数组/链 ... -
初识ThreadLocal
2015-07-07 13:15 1521最近公司在进行Java开发人员的招聘活动,其中有一道面试题 ... -
摩尔投票法
2015-06-30 20:13 18435摩尔投票法 提问: 给定一个int型数组,找出该数 ... -
小心寄存器
2012-11-08 13:53 4试试这段代码就知道了 public cla ... -
简单工作流引擎
2012-07-06 16:58 2419从公司的一个项目中挖出来的工作流引擎的代码,虽然是一个很简单的 ... -
Always clean the ThreadLocal variables.
2012-05-24 09:16 1221Any variable stored in ThreadLo ... -
STRUTS2 源码 - Logging System
2012-05-24 08:51 1412看了STRUTS2的源码,了解了它的logging系统,觉得还 ... -
在线词典的数据结构实现。
2012-05-18 08:37 0昨天在网上看到了一道百度的面试题: Baidu写道 ... -
Log4j 代码学习 - Factory
2012-05-17 08:47 1116我们最早提到,Log4j的初始代码在LogManager的静态 ... -
Log4j 代码学习 - Appender
2012-05-16 09:09 1366在上一篇文章里,我们 ... -
Log4j 代码学习
2012-05-15 14:58 1169最近闲来无事,正好手头上有Log4j的代码,于是就拿来学习了下 ... -
java7中的ThreadLocalRandom(转)
2012-01-20 09:08 4363今天早上看到一个关于java7中的ThreadLocalRan ... -
(转)追MM与23种设计模式
2011-11-16 14:13 10041、FACTORY—追MM少不了请吃饭了,麦当劳的鸡翅和肯德 ... -
(转)Java 参数列表
2011-11-05 19:48 2955下面的讨论以Windows ... -
(转)TOMCAT源码分析
2011-10-17 16:06 2153TOMCAT源码分析(启动框架 ... -
java写的四则运算器
2011-08-19 22:19 2744本打算做一个从RE到NFA的转换器,思路已经理清了,但是在动手 ... -
MBeanServer中instantiate 和 invoke的区别
2011-06-02 11:52 1332JMX中有两种方式调用另一个MBean中的方法 先创建一个M ... -
JMX 的一个简单例子
2011-05-30 17:41 1090废话不多说,上代码: HelloWorldMBean接口 ... -
执行JAR文件的一些问题(转)
2011-03-25 13:41 1391大家都知道一个java应用项目可以打包成一个jar,当然你必须 ...
相关推荐
Abstract: Servlet program running in the server-side, dynamically generated Web page with the traditional CGI and many other similar compared to CGI technology, Java Servlet with a more efficient, ...
Servlet 3.0是Java服务器页面(JSP)和Servlet技术的一个重要版本更新,它引入了许多新特性,提升了Web应用程序的开发效率和灵活性。在JSR-315(JavaTM Servlet 3.0 API Specification)中,专家小组对这项规范进行...
Overview Package Class Tree Deprecated Index Help PREV NEXT FRAMES NO FRAMES A B C D E F G H I J L P R S U V -------------------------------------------------------------------------------- A ...
Servlet和JSP(JavaServer Pages)是Java技术在Web开发中的两大核心组件,它们主要用于构建动态Web应用程序。本文将提供一个关于Servlet和JSP技术的概述,深入理解这两个技术的角色、优势以及如何配置和测试环境。 ...
Servlet 2.4 API 是Java Web开发中一个重要的组件,它是Java Servlet技术的规范版本2.4。这个压缩包文件 "servlet2.4_API.rar" 包含了一系列的文档和资源,帮助开发者理解和使用Servlet API。以下是这些文件的具体...
Servlet和JSP技术概述 Servlet和JavaServer Pages(JSP)是Java在Web开发中的核心组件,主要用于构建动态网页和处理服务器端的数据。本讲座将深入探讨这两种技术的角色、优势以及配置方法。 **理解Servlet的角色**...
`constant-values.html`列出所有常量字段的值,`overview-tree.html`展示了包和类的层次结构,`deprecated-list.html`列出了已被弃用的API,`serialized-form.html`详细描述了可序列化的类,`allclasses-frame.html`...
01-Overview-and-Setup-Chinese.pdf可能涵盖了Servlet和JSP的基本概念,包括它们的作用、工作原理以及如何在开发环境中进行配置。这部分内容可能会讲解如何在Eclipse、IntelliJ IDEA等IDE中设置Tomcat服务器,创建...
- **Overview**:异常处理是任何健壮的Web应用程序不可或缺的一部分。 - **@ExceptionHandler**:该注解用于处理特定类型的异常。 - **Framework Exceptions**:Spring Web MVC本身抛出的一些异常,如`...
对于Web开发,Servlet和JSP是基础,而现代的Spring MVC或Thymeleaf等技术提供了更高级的解决方案。 在分布式系统领域,Java的RMI(远程方法调用)和JMS(Java消息服务)允许不同进程间的通信。随着云计算的发展,...
通过阅读"java_web_overview.pdf"这份文档,你将能够更全面地理解Java Web开发的各个方面,包括基本概念、核心技术和常用工具体验。这份资源旨在帮助开发者快速上手并提升在Java Web领域的专业技能。
Servlet和JSP(JavaServer Pages)是Java Web开发中的核心技术,主要用于构建动态网页。Servlet API 3.0是Java Servlet规范的一个版本,它引入了许多新特性,提升了开发者的工作效率和应用程序的性能。在这个资源包...
An Overview of Servlet and JSP Technology. EPFL, Lausanne, Switzerland. 关键词 * Servlet * JSP * Java Web 应用程序 * 动态网页 * Web 服务器 * 应用服务器 * HTTP * HTML * JavaScript * Java 代码 * 电子...
帮助文档,We start with an overview of how and where servlets fit into the enterprise
Servlet 容器是一种运行时环境,用于托管和管理 Java Web 应用中的 Servlet 和 JSP。其主要职责包括: - **管理生命周期**:控制 Servlet 的创建、初始化、服务和销毁。 - **处理请求**:接收客户端请求,将请求分发...
Servlet容器随后调用对应的HelloServlet,Servlet根据请求信息生成响应内容,然后将内容写入ServletResponse。最后,容器将这个响应转发给发出请求的客户端。 Tomcat服务器的结构包括多个可配置的组件,特别是...
Java Web开发技术是构建基于Java平台的Web应用程序的关键技术,主要涉及Servlet、JSP(JavaServer Pages)等核心概念。本文由孙卫琴撰写,参考书籍《Tomcat与Java Web开发技术详解》,旨在为初学者提供一个全面的...
这一套教程对于初学者特别有用,我很久以前就收集了,希望对大家有帮助,我没有要积分下载,方便部分朋友,这些概念特别的重要,good good study ,day day up
01-Overview-and-Setup-Chinese.pdf 02-Servlet-Basics-Chinese.pdf 03-Form-Data-Chinese.pdf 04-Request-Headers-Chinese.pdf 05-Status-Codes-Chinese.pdf 06-Response-Headers-Chinese.pdf 07-Cookies-Chinese....
2. **组件模型**:J2EE提供了多种类型的组件,如Servlet、JSP(JavaServer Pages)、EJB(Enterprise JavaBeans)。Servlet用于处理HTTP请求,JSP用于生成动态网页,而EJB则作为可部署的业务逻辑组件。 3. **Web...