honzeland

          記錄點滴。。。

          常用鏈接

          統計

          Famous Websites

          Java

          Linux

          P2P

          最新評論

          J2EE學習筆記:

          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

          主站蜘蛛池模板: 高清| 贺兰县| 柳林县| 永顺县| 宜阳县| 无为县| 嵊州市| 鄂温| 托克托县| 洪江市| 青冈县| 鄱阳县| 即墨市| 慈溪市| 尼木县| 桑植县| 登封市| 连城县| 高台县| 凤凰县| 霍邱县| 乌兰县| 周至县| 邵武市| 合山市| 巩留县| 无极县| 甘洛县| 荣成市| 新津县| 武义县| 锦屏县| 固始县| 石嘴山市| 理塘县| 阿城市| 博爱县| 承德县| 富川| 台南县| 旺苍县|