konhon

          忘掉過去,展望未來。找回自我,超越自我。
          逃避不一定躲的過, 面對不一定最難過, 孤單不一定不快樂, 得到不一定能長久, 失去不一定不再擁有, 可能因?yàn)槟硞€(gè)理由而傷心難過, 但我卻能找個(gè)理由讓自己快樂.

          Google

          BlogJava 首頁 新隨筆 聯(lián)系 聚合 管理
            203 Posts :: 0 Stories :: 61 Comments :: 0 Trackbacks
          < description > ? < display > ? < icon >
          這三個(gè)元素提供了Web容器部署工具用描述應(yīng)用的信息.

          < icon >
          ??
          < small-icon > /images/small.gif </ small-icon > ? <!-- 16*16 -->
          ??
          < large-icon > /images/large.jpg </ large-icon > ? <!-- 32*32 -->
          </ icon >
          < display-name > The?applicaiton?name </ display-name >
          < description > A?longer?description?of?the?application </ description >

          < distrubutable >
          < distributable > 元素用於告知Web容器:?應(yīng)用設(shè)計(jì)為在分布式Web容器中運(yùn)行.此元素不含體.

          < context-param >
          通過使用
          < context-param > 元素,?可以定義對應(yīng)用的所有組件(servlet和JSP頁面)都可用的上下文參數(shù).

          < context-param >
          ??
          < param-name > jdbcURL </ param-name >
          ??
          < param-value > jdbc:Microsoft:sqlserver://localhost:1433;databasename='aa' </ param-value >
          </ context-param >

          < filter >
          < filter > 元素可以注冊一個(gè)過濾器組件.

          < filter >
          ??
          < filter-name > accessControl </ filter-name >
          ??
          < fitler-class > com.mycomp.AccessControlFilter </ filter-class >
          ??
          < init-param >
          ?????
          < param-name > loginPage </ param-name >
          ?????
          < param-value > /login.jsp </ param-name >
          ??
          </ init-param >
          </ filter >

          < filter-mapping >
          能過使用
          < filter-mapping > 元素,?可以將過濾器映射至一個(gè)URI模式,?或者映射至一個(gè)Servlet.

          < filter-mapping >
          ??
          < filter-name > accessControl </ filter-name >
          ??
          < url-pattern > /protected </ url-pattern >
          </ filter-mapping >
          < filter-mapping >
          ??
          < filter-name > accessControl </ filter-name >
          ??
          < servlet-name > servletName </ servlet-name >
          < filter-mapping >


          < listener >
          < listener > 用於注冊一個(gè)監(jiān)聽組件.

          < listener >
          ??
          < listener-class > com.mycomp.AppInitListener </ listener-class >
          </ listener >

          < servlet >
          < servlet > 定義了Servlet或JSP頁面的細(xì)節(jié).?最常見的情況是,?此元素僅把一個(gè)Servlet或JSP頁面與一個(gè)短名相

          關(guān)聯(lián),?並指定初始化參數(shù):
          < servlet >
          ??
          < servlet-name > purchase </ servlet-name >
          ??
          < servlet-class > com.mycomp.servlets.PurchaseServlet </ server-class >
          ??
          < init-param >
          ?????
          < param-name > maxAmount </ param-name >
          ?????
          < param-value > 500.00 </ param-value >
          ??
          </ init-param >
          </ servlet >
          < servlet >
          ??
          < servlet-name > order-form </ servlet-name >
          ??
          < jsp-file > /po/orderform.jsp </ jsp-file >
          ??
          < init-param >
          ?????
          < param-name > bgColor </ param-name >
          ?????
          < param-value > blue </ param-value >
          ??
          </ init-param >
          </ servlet >

          < load-on-starup > 子元素可以告訴容器在應(yīng)用開始時(shí)加載Servlet.這個(gè)值是一個(gè)正整數(shù),?指示了Servlet相對於

          其它Servlet的加載時(shí)間.此值較小的Servlet要早於值較大的Servlet得到加載.
          < servlet >
          ??
          < servlet-name > controller </ servlet-name >
          ??
          < servlet-class > com.mycomp.servlets.ControllerServlet </ servlet-class >
          ??
          < load-on-starup > 1 </ load-on-starup >
          </ servlet >

          < servlet-mapping >
          < servlet-mapping > 元素將一個(gè)Servlet或JSP頁面映射至一個(gè)URL模式.

          路徑前綴模式:
          < servlet-mapping >
          ??
          < servlet-name > purchase </ servlet-name >
          ??
          < url-pattern > /po/* </ url-pattern >
          </ servlet-mapping >
          完全匹模模工:
          < servlet-mapping >
          ??
          < servlet-name > sales-report </ servlet-name >
          ??
          < url-pattern > /report </ url-pattern >
          < servlet-mapping >
          擴(kuò)展名映射模式:
          < servlet-mapping >
          ??
          < servlet-name > XMLProcessor </ servlet-name >
          ??
          < url-pattern > *.xml </ url-pattern >
          </ servlet-mapping >

          < session-config >
          < session-config > 元素可以定制會(huì)話處理屬性.在一個(gè)部署描述文件中只能使用一個(gè)此類元素.

          < session-config >
          ??
          < session-timeout > 30 </ session-timeout >
          </ session-config >

          < mime-mapping >
          < mime-mapping > 元素可以定義應(yīng)用所需的映射.
          Servlet可能需要了解一個(gè)文件擴(kuò)展名對應(yīng)於哪一種mime類型,?而使用此元素即可以定義這樣一個(gè)映射:

          < mime-mapping >
          ??
          < extension > wml </ extension >
          ??
          < mime-type > text/vnd.wap.wml </ mime-type >
          </ mime-mapping >

          < welcome-file-list >
          < welcome-file-list > 元素可以定義要在目錄中查找並提供文件的有序表.如果使用了多個(gè)此類元素,?容器會(huì)將

          其合並.

          < welcome-file-list >
          ??
          < welcome-file > index.html </ welcome-file >
          ??
          < welcome-file > index.htm </ welcome-file >
          ??
          < welcome-file > default.html </ welcome-file >
          ??
          < welcome-file > default.htm </ welcome-file >
          </ welcome-file-list >

          < error-page >
          < error-page > 元素可以定義向用戶告知各種錯(cuò)誤的頁面.

          < error-page >
          ??
          < error-code > 404 </ error-code >
          ??
          < location > /errors/404.html </ location >
          </ error-page >

          < error-page >
          ??
          < exception-type > javax.servlet.ServletException </ exception-type >
          ??
          < location > /errors/exception.jsp </ location >
          </ error-page >

          < jsp-config >
          < jsp-config > 元素內(nèi)嵌有處理JSP配置的大多數(shù)元素,?在一個(gè)部署描述文件中只能使用一個(gè)此類元素.
          < jsp-property-group >
          < jsp-property-group > 元素為一組JSP頁面定義了一個(gè)屬性.?這組頁面由一個(gè)或多個(gè) < url-pattern > 元素定義.
          < jsp-config >
          ??
          < jsp-property-group >
          ????
          < url-pattern > *.xml </ url-pattern >
          ????
          < el-ignored > true </ el-ignored >
          ????
          < page-encoding > Shift_JTS </ page-encode >
          ????
          < scripting-invalid > true </ scripting-invalid >
          ??
          < jsp-propery-group >
          </ jsp-config >


          < resource-env-ref >
          < resource-env-ref > 元素聲明了通過JNDI可訪問的應(yīng)用資源.
          < resource-env-ref >
          ??
          < resource-env-ref-name > /jms/StockQueue </ resource-env-ref-name >
          ??
          < resource-env-ref-type > /javax.jms.Queue </ resource-env-ref-type >
          < resource-env-ref >

          < resource-ref >
          < resource-ref > 元素為應(yīng)用對象定義了JNDI可訪問對象工廠.

          < resource-ref >
          ??
          < res-ref-name > /jms/Production </ res-ref-name >
          ??
          < res-ref-type > /javax.sql.DataSource </ res-ref-type >
          ??
          < res-auth > Container </ res-auth >
          </ resource-ref >

          < security-constraint >
          < security-constraint > 元素定義了如何訪問資源以及由誰訪問資源.

          < login-config >
          < login-config > 元素聲明了對於受保護(hù)資源使用何種鑒別方法.在一個(gè)部署描述文件中只能使用一個(gè)此類元素.
          < login-config >
          ??
          < auth-method > FORM </ auth-method >
          ??
          < form-login-config >
          ????
          < form-login-page > /login/login.html </ form-login-page >
          ????
          < form-error-page > /login/error.html </ form-error-page >
          ??
          </ form-login-config >
          </ login-config >

          < security-role >
          < security-role > 元素用於定義應(yīng)用所用的角色名.
          < security-role >
          ??
          < role-name > admin </ role-name >
          </ security-role >
          < security-role >
          ??
          < role-name > user </ role-name >
          </ security-role >


          < locale-encoding-mapping-list >
          < locale-encoding-mapping-list > 元素定義了本地化環(huán)境和響應(yīng)編碼之間的映射,?如果使用了多個(gè)此類元素,?

          容器會(huì)將其合並.
          < locale-encoding-mapping-list >
          ??
          < locale-encoding-mapping >
          ????
          < locale > locale </ locale >
          ????
          < encoding > encoding </ encoding >
          ??
          </ locale-encoding-mapping >
          </ locale-encoding-mapping-list >


          < env-entry >
          < env-entry > 元素用於定義可由應(yīng)用通過JNDI訪問的簡單對象,?如String?或?Boolean.
          < env-entry >
          ??
          < env-entry-name > maxConnection </ env-entry-name >
          ??
          < env-entry-type > java.lang.Integer </ env-entry-type >
          ??
          < env-entry-value > 100 </ env-entry-value >
          </ env-entry >

          < ejb-ref >
          < ejb-ref > 元素通常用於聲明應(yīng)用所用的一個(gè)遠(yuǎn)程EJB引用.
          < ejb-ref >
          ??
          < ejb-ref-name > ejb/Payroll </ ejb-ref-name >
          ??
          < ejb-ref-type > Session </ ejb-ref-type >
          ??
          < home > com.mycomp.PayrollHome </ home >
          ??
          < remote > com.mycomp.Payroll </ remote >
          </ ejb-ref >

          < ejb-local-ref >
          < ejb-local-ref > 元素通常用於聲明應(yīng)用所用的一個(gè)本地EJB引用.
          < ejb-local-ref >
          ??
          < ejb-ref-home > ejb/Payroll </ ejb-ref-name >
          ??
          < ejb-ref-type > Session </ ejb-ref-type >
          ??
          < local-home > com.mycomp.PayrollHome </ local-home >
          ??
          < local > com.mycomp.Payroll </ local >
          </ ejb-local-ref >

          < service-ref >
          < service-ref > 元素用於聲明應(yīng)用所用Web服務(wù)的一個(gè)引用.

          < message-destination-ref >
          < message-destination-ref > 元素用於聲明應(yīng)用所用的JMS消息和目標(biāo)引用.

          < message-destination >
          < message-destination > 元素可為應(yīng)用所用的一個(gè)JMS消息目標(biāo)聲明一個(gè)邏輯名.






          posted on 2006-03-28 22:52 konhon 優(yōu)華 閱讀(1280) 評論(0)  編輯  收藏 所屬分類: JSP/Servlet
          主站蜘蛛池模板: 尤溪县| 洞头县| 宣武区| 景宁| 图片| 德令哈市| 吉木乃县| 泊头市| 上虞市| 新河县| 武功县| 韶山市| 桐乡市| 贵德县| 新乡县| 遵化市| 成都市| 图木舒克市| 礼泉县| 莱西市| 防城港市| 靖州| 阳曲县| 辛集市| 左云县| 宿松县| 高淳县| 进贤县| 福州市| 昆山市| 汽车| 当雄县| 黎平县| 治县。| 杭州市| 出国| 常宁市| 石家庄市| 宝鸡市| 崇明县| 万州区|