honzeland

          記錄點滴。。。

          導(dǎo)航

          <2006年10月>
          24252627282930
          1234567
          891011121314
          15161718192021
          22232425262728
          2930311234

          留言簿(4)

          隨筆分類

          文章分類

          收藏夾

          隨筆檔案

          文章檔案

          閱讀排行榜

          評論排行榜

          常用鏈接

          統(tǒng)計

          Famous Websites

          Java

          Linux

          P2P

          最新評論

          J2EE學(xué)習(xí)筆記:

          Part One: The Web Tier

          Section One: Configuring Web Applications

          Mapping URLs to Web Components

          When a request is received by the web container it must determine which web component should handle the request. It does so by mapping the URL path contained in the request to a web application and a web component. A URL path contains the context root and an alias:

          http://host:port/context_root/alias

          A context root identifies a web application in a Java EE server. You specify the context root when you deploy a web module. A context root must start with a forward slash (/) and end with a string.
          ?
          The alias identifies the web component that should handle a request. The alias path must start with a forward slash (/) and end with a string or a wildcard expression with an extension (for example, *.jsp). Since web containers automatically map an alias that ends with *.jsp, you do not have to specify an alias for a JSP page unless you wish to refer to the page by a name other than its file name.

          Declaring Welcome Files

          For example, suppose you define a welcome file welcome.html. When a client requests a URL such as host:port/webapp/directory, where directory is not mapped to a servlet or JSP page, the file host:port/webapp/directory/welcome.html is returned to the client.

          If no welcome file is specified, the Application Server will use a file named index.XXX, where XXX can be html or jsp, as the default welcome file. If there is no welcome file and no file named index.XXX, the Application Server returns a directory listing.

          To specify a welcome file in the web application deployment descriptor, you need to nest a welcome-file element inside a welcome-file-list element. The welcome-file element defines the JSP page to be used as the welcome page. Make sure this JSP page is actually included in your WAR file.

          Setting Initialization Parameters

          The web components in a web module share an object that represents their application context. You can pass initialization parameters to the context or to a web component.

          To add a context parameter you need the following in the example's web.xml file:

          • A param-name element that specifies the context object
          • A param-value element that specifies the parameter to pass to the context object.
          • A context-param element that encloses the previous two elements.

          To add a web component initialization parameter you need the following in the example's web.xml file:

          • A param-name element that specifies the name of the initialization parameter
          • A param-value element that specifies the value of the initialization parameter
          • An init-param element that encloses the previous two elements

          Mapping Errors to Error Screens

          Declaring Resource References


          posted on 2006-10-13 15:53 honzeland 閱讀(349) 評論(0)  編輯  收藏 所屬分類: Java

          主站蜘蛛池模板: 南郑县| 嘉定区| 汾西县| 屏边| 龙川县| 贵定县| 塔河县| 新乡市| 抚顺县| 克山县| 巴林左旗| 陆河县| 仁怀市| 新疆| 集安市| 五常市| 江源县| 通榆县| 台州市| 云和县| 印江| 斗六市| 开江县| 绩溪县| 永年县| 哈巴河县| 长葛市| 明水县| 理塘县| 来安县| 越西县| 孙吴县| 富平县| 长岭县| 文昌市| 卓尼县| 察哈| 永吉县| 通河县| 彰武县| 登封市|