Servlets

Servlets are Java™ programs that use the Java Servlet Application Programming Interface (API). You must package servlets in a web application archive (WAR) file or web module for deployment to the application server. Servlets run on a Java-enabled web server and extend the capabilities of a web server, similar to the way applets run on a browser and extend the capabilities of a browser.

Servlets can support dynamic web page content, provide database access, serve multiple clients at one time, and filter data.

In the application server, discussions of servlets focus on HTTP servlets, which serve Web-based clients.

You can define servlets as welcome files. Non-servlet resources are served only when the fileServingEnabled attribute is set to true in the IBM extensions XMI file, ibm-web-ext.xmi, located in each Web module WEB-INF directory or by using an assembly tool to set the property in the source .war file. Serving welcome files is connected to serving static content. Therefore the fileServingEnabled attribute is set in the web module.

支援的配置 支援的配置: 對於 IBM® 延伸和連結檔而言,.xmi 或 .xml 副檔名取決於您是使用 Java EE 5 之前的應用程式或模組,或 Java EE 5 或更新版本的應用程式或模組。 IBM 延伸或連結檔稱為 ibm-*-ext.xmi 或 ibm-*-bnd.xmi,其中 * 是延伸或連結檔的類型,例如:app、application、ejb-jar 或 web。 適用的條件如下:
  • 如果應用程式或模組使用第 5 版之前的 Java EE,副檔名必須是 .xmi。
  • 如果應用程式或模組使用 Java EE 5 或更新的版本,副檔名必須是 .xml。 如果 .xmi 檔是隨附在應用程式或模組,則本產品會忽略 .xmi 檔。

不過,即使應用程式含有 Java EE 5 之前的檔案,且所用的副檔名是 .xmi,其中也可以有 Java EE 5 或更新版本的模組。

ibm-webservices-ext.xmiibm-webservices-bnd.xmiibm-webservicesclient-bnd.xmiibm-webservicesclient-ext.xmiibm-portlet-ext.xmi 檔會繼續使用 .xmi 副檔名。

sptcfg

Context parameters

A servlet context defines the server view of the web application within which the servlet is running. The context also supports a servlet to access its available resources. Using the servlet context, a servlet can log events, obtain URL references to resources, and set and store attributes for other servlets in the context to use. These properties declare the parameters for the context of a web application. The properties convey setup information, such as the email address for the webmaster or the name of a system with critical data.

Servlet mappings

A servlet mapping is a correspondence between a client request and a servlet. Web containers use URL paths to map client requests to servlets, and follow the URL path-mapping rules as specified in the Java Servlet specification. The container uses the Uniform Resource Identifier (URI) from the request, minus the context path, as the path to map to a servlet. The container chooses the longest matching available context path from the list of web applications that it hosts.


指出主題類型的圖示 概念主題



時間戳記圖示 前次更新: July 9, 2016 11:12
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=cweb_sov2
檔名:cweb_sov2.html