Struts2(1):Struts2的設定檔

來源:互聯網
上載者:User

今天,我們先不考慮外掛程式包中帶的設定檔,這個檔案在後面會討論。Struts2最常用的設定檔有4個:

Struts2的設定檔
檔案名稱 所屬 檔案位置 檔案作用
struts-default.xml 架構內建 struts2-core-2.1.8.1.jar 架構內建的結果類型定義、攔截器定義、
攔截器引用定義
struts.xml 開發人員建立 src目錄下(實際在classes目錄下) 定義開發人員編寫的Result、
攔截器和Action組件
default.properties 架構內建 struts2-core-2.1.8.1.jar / org.apache.struts2 定義了架構的一些系統參數
struts.properties 開發人員建立 src目錄下(實際在classes目錄下) 用於覆蓋default.properties
中的系統配置

下面看看default.properties中都定義了哪些系統參數:

default.properties中定義的系統參數一覽
參數名及其設定的預設值 說明
struts.i18n.encoding=UTF-8 ...
struts.objectFactory.spring.autoWire = name  
struts.objectFactory.spring.useClassCache = true  
struts.objectFactory.spring.autoWire.alwaysRespect = false  
struts.multipart.parser=jakarta  
struts.multipart.saveDir=  
struts.multipart.maxSize=2097152  
struts.action.extension=action,,  
struts.serve.static=true  
struts.serve.static.browserCache=true  
struts.enable.DynamicMethodInvocation = true  
struts.enable.SlashesInActionNames = false  
struts.tag.altSyntax=true  
struts.devMode = false  
struts.i18n.reload=false  
struts.ui.theme=xhtml  
struts.ui.templateDir=template  
struts.ui.templateSuffix=ftl  
struts.configuration.xml.reload=false  
struts.velocity.configfile = velocity.properties  
struts.velocity.contexts =  
struts.velocity.toolboxlocation=  
struts.url.http.port = 80  
struts.url.https.port = 443  
struts.url.includeParams = none  
struts.dispatcher.parametersWorkaround = false  
struts.freemarker.templatesCache=false  
struts.freemarker.beanwrapperCache=false  
struts.freemarker.wrapper.altMap=true  
struts.freemarker.mru.max.strong.size=100  
struts.xslt.nocache=false  
struts.mapper.alwaysSelectFullNamespace=false  
struts.ognl.allowStaticMethodAccess=false  
struts.el.throwExceptionOnFailure=false  
struts.ognl.logMissingProperties=false  
struts.ognl.enableExpressionCache=true  

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.