posts - 0,  comments - 17,  trackbacks - 0
來源:http://www.blogjava.net/konhon/archive/2006/03/29/38012.html
< description >   < display >   < icon > 
這三個元素提供了Web容器部署工具用描述應用的信息.

 
< 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容器: 應用設計為在分布式Web容器中運行.此元素不含體.

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

 
< context-param > 
   
< param-name > jdbcURL </ param-name > 
   
< param-value > jdbc:Microsoft:sqlserver://localhost:1433;databasename='aa' </ param-value > 
 
</ context-param > 
 
 
< filter > 
 
< filter > 元素可以注冊一個過濾器組件.

 
< 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 > 元素, 可以將過濾器映射至一個URI模式, 或者映射至一個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 > 用於注冊一個監聽組件.

 
< listener > 
   
< listener-class > com.mycomp.AppInitListener </ listener-class > 
 
</ listener > 
 
 
< servlet > 
 
< servlet > 定義了Servlet或JSP頁面的細節. 最常見的情況是, 此元素僅把一個Servlet或JSP頁面與一個短名相

關聯, 並指定初始化參數:
 
< 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 > 子元素可以告訴容器在應用開始時加載Servlet.這個值是一個正整數, 指示了Servlet相對於

其它Servlet的加載時間.此值較小的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 > 元素將一個Servlet或JSP頁面映射至一個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 > 
擴展名映射模式:
 
< servlet-mapping > 
   
< servlet-name > XMLProcessor </ servlet-name > 
   
< url-pattern > *.xml </ url-pattern > 
 
</ servlet-mapping > 
 
 
< session-config > 
 
< session-config > 元素可以定制會話處理屬性.在一個部署描述文件中只能使用一個此類元素.

 
< session-config > 
   
< session-timeout > 30 </ session-timeout > 
 
</ session-config > 
 
 
< mime-mapping > 
 
< mime-mapping > 元素可以定義應用所需的映射.
Servlet可能需要了解一個文件擴展名對應於哪一種mime類型, 而使用此元素即可以定義這樣一個映射:

 
< mime-mapping > 
   
< extension > wml </ extension > 
   
< mime-type > text/vnd.wap.wml </ mime-type > 
 
</ mime-mapping > 
 
 
< welcome-file-list > 
 
< welcome-file-list > 元素可以定義要在目錄中查找並提供文件的有序表.如果使用了多個此類元素, 容器會將

其合並.

 
< 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 > 元素可以定義向用戶告知各種錯誤的頁面.

 
< 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 > 元素內嵌有處理JSP配置的大多數元素, 在一個部署描述文件中只能使用一個此類元素.
 
< jsp-property-group > 
 
< jsp-property-group > 元素為一組JSP頁面定義了一個屬性. 這組頁面由一個或多個 < 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可訪問的應用資源.
 
< 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 > 元素為應用對象定義了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 > 元素聲明了對於受保護資源使用何種鑒別方法.在一個部署描述文件中只能使用一個此類元素.
 
< 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 > 元素用於定義應用所用的角色名.
 
< 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 > 元素定義了本地化環境和響應編碼之間的映射, 如果使用了多個此類元素, 

容器會將其合並.
 
< locale-encoding-mapping-list > 
   
< locale-encoding-mapping > 
     
< locale > locale </ locale > 
     
< encoding > encoding </ encoding > 
   
</ locale-encoding-mapping > 
 
</ locale-encoding-mapping-list > 
 
 
 
< env-entry > 
 
< env-entry > 元素用於定義可由應用通過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 > 元素通常用於聲明應用所用的一個遠程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 > 元素通常用於聲明應用所用的一個本地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 > 元素用於聲明應用所用Web服務的一個引用.

 
< message-destination-ref > 
 
< message-destination-ref > 元素用於聲明應用所用的JMS消息和目標引用.

 
< message-destination > 
 
< message-destination > 元素可為應用所用的一個JMS消息目標聲明一個邏輯名.






posted on 2008-10-31 12:38 xyz 阅读(1191) 评论(0)  编辑  收藏 所属分类: 网络文摘

只有注册用户登录后才能发表评论。


网站导航:
 

<2024年5月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

留言簿

随笔档案(1)

文章分类(44)

文章档案(46)

收藏夹(1)

Adobe

AOP

API

appServer

BI

c

  • c-free
  • codeblocks
  • codelite
  • CodeLite IDE 是一个强大的开源,跨平台的 C/C++整合开发环境. 支持包括 Windows、Linux 和 Mac 系统下运行
  • codelite官网
  • dev-c++
  • Dev-C++是一个C&C++开发工具,它是一款自由软件,遵守GPL协议。
  • GCC
  • GCC 原名为 GNU C 语言编译器(GNU C Compiler),因为它原本只能处理 C语言。GCC 很快地扩展,变得可处理 C++。之后也变得可处理 Fortran、Pascal、Objective-C、Java, 以及 Ada 与其他语言。

Cache

CMS

DB

eclipse

FreeMarker

hibernate

html5

ibatis

java

jquery

js

json

Linux

Log

mail server

mobile

mysql

oauth

openID

other

PHP

portal

report

Scheduler

schema

Security

SOA

spring

struts

UI原型设计

w3c

Wap

webservice

xml

供应链管理

博客链接

好网站

工作流

开源网

招聘

插件下载

操作系统

构建可伸缩的系统

构建工具

测试

  • IETest
  • IE官网
  • OpenSTA
  • Siege
  • Siege是一个压力测试和评测工具,设计用于WEB开发这评估应用在压力下的承受能力

游戏

源码托管

经营

资源

金融/财务

搜索

  •  

最新评论