Struts2的properties檔案

來源:互聯網
上載者:User

是Struts2的設定檔,預設叫default.properties檔案。它配置struts的預設配置,例如:struts2的預設配置

  為action就是在該檔案中定義。

這個檔案提供了一種更改架構預設行為方式的機制。在一般情況下,如果不是打算讓調試更加方便的話,你根本無須更改這個檔案。在“struts.properties”檔案中定義的屬性都可以在“web.xml”檔案的“init-param”標籤中進行配置,或者通過“struts.xml”檔案中的“constant” 標籤來修改。

此檔案位於Struts2的jar包中,唯讀檔案,我們無法修改,那我們如何修改Strut2的預設配置?

解決辦法:建立一個struts.properties在classpath的根目錄下。

例如:修改Struts2的預設尾碼為.do

struts.properties檔案中寫

   struts.action.extension=do

Struts.properties相關配置祥解:

struts.action.extension

設定Struts2的尾碼,預設為action

struts.configuration

org.apache.struts2.config.Configuration介面名

struts.configuration.files

struts自動載入的一個設定檔列表,

預設載入struts-default.xml,struts-plugin.xml,struts.xml

struts.configuration.xml.reload

是否載入xml配置(true,false),預設為true

struts.continuations.package

含有actions的完整連續的package名稱

struts.custom.i18n.resources

載入附加的國際化屬性檔案(不包含.properties尾碼)

struts.custom.properties

載入附加的設定檔的位置

struts.devMode

是否為struts開發模式

struts.dispatcher.parametersWorkaround

(某些版本的weblogic專用)是否使用一個servlet請求參數工作區

(PARAMETERSWORKAROUND)

struts.enable.DynamicMethodInvocation

允許動態方法引動過程,使用萬用字元動態調用action

struts.freemarker.manager.classname

org.apache.struts2.views.freemarker.FreemarkerManager介面名

struts.i18n.encoding

國際化資訊內碼,編號,預設為UTF-8

struts.i18n.reload

是否國際化資訊自動載入

struts.locale

預設的國際化地區資訊

struts.mapper.class

org.apache.struts2.dispatcher.mapper.ActionMapper介面

struts.multipart.maxSize

multipart請求資訊的最大尺寸(檔案上傳用)

struts.multipart.parser

專為multipart請求資訊使用的org.apache.struts2.dispatcher.multipart.MultiPartRequest解析器介面(檔案上傳用)

struts.multipart.saveDir

設定儲存上傳檔案的目錄夾

struts.objectFactory

com.opensymphony.xwork2.ObjectFactory介面(spring)

struts.objectFactory.spring.autoWire

是否自動綁定Spring

struts.objectFactory.spring.useClassCache

是否spring應該使用自身的cache

struts.objectTypeDeterminer

com.opensymphony.xwork2.util.ObjectTypeDeterminer介面

struts.serve.static.browserCache

是否struts過濾器中提供的靜態內容應該被瀏覽器緩衝在頭部屬性中

struts.serve.static

是否struts過濾器應該提供靜態內容

struts.tag.altSyntax

是否可以用替代的文法替代tags

struts.ui.templateDir

UI templates的目錄夾

struts.ui.theme

預設的UI template主題

struts.url.http.port

設定http連接埠

struts.url.https.port

設定https連接埠

struts.url.includeParams

在url中產生 預設的includeParams

struts.velocity.configfile

velocity設定檔路徑,預設為velocity.properties

struts.velocity.contexts

velocity的context列表

struts.velocity.manager.classname

org.apache.struts2.views.velocity.VelocityManager介面名

struts.velocity.toolboxlocation

velocity工具盒的位置是否XSLT模版應該被緩衝

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.