struts2 Convention Plugin Configuration reference

来源:互联网 发布:杭州城乡院 知乎 编辑:程序博客网 时间:2024/05/28 15:53

Add a constant element to your struts config file to change the value of a configuration setting, like:

<constant name="struts.convention.result.path" value="/WEB-INF/mytemplates/"/>
NameDefault ValueDescriptionstruts.convention.action.alwaysMapExecutetrueSet to false, to prevent Convention from creating a default mapping to "execute" when there are other methods annotated as actions in the classstruts.convention.action.includeJars Comma separated list of regular expressions of jar URLs to be scanned. eg. ".myJar-0\.2.,.thirdparty-0\.1."struts.convention.action.packages An optional list of action packages that this should create configuration for (they don't need to match a locator pattern)struts.convention.result.path/WEB-INF/content/Directory where templates are locatedstruts.convention.result.flatLayouttrueIf set to false, the result can be put in its own directory: resultsRoot/namespace/actionName/result.extensionstruts.convention.action.suffixActionSuffix used to find actions based on class namesstruts.convention.action.disableScanningfalseScan packages for actionsstruts.convention.action.mapAllMatchesfalseCreate action mappings, even if no @Action is foundstruts.convention.action.checkImplementsActiontrueCheck if an action implements com.opensymphony.xwork2.Action to create an action mappingstruts.convention.default.parent.packageconvention-defaultDefault parent package for action mappinsstruts.convention.action.name.lowercasetrueConvert action name to lowercasestruts.convention.action.name.separator-Separator used to build the action name, MyAction -> my-action. This character is also used as the separator between the action name and the result in templates, like action-result.jspstruts.convention.package.locatorsaction,actions,struts,struts2Packages whose name end with one of these strings will be scanned for actionsstruts.convention.package.locators.disablefalseDisable the scanning of packages based on package locatorsstruts.convention.exclude.packagesorg.apache.struts.*,
org.apache.struts2.*,
org.springframework.web.struts.*,
org.springframework.web.struts2.*,
org.hibernate.*Packages excluded from the action scanningstruts.convention.package.locators.basePackage If set, only packages that start with its value will be scanned for actionsstruts.convention.relative.result.typesdispatcher,velocity,freemarkerThe list of result types that can have locations that are relative and the result location (which is the resultPath plus the namespace) prepended to themstruts.convention.redirect.to.slashtrueA boolean parameter that controls whether or not this will handle unknown actions in the same manner as Apache, Tomcat and other web servers. This handling will send back a redirect for URLs such as /foo to /foo/ if there doesn't exist an action that responds to /foostruts.convention.classLoader.excludeParenttrueExclude URLs found by the parent class loader from the list of URLs scanned to find actions (needs to be set to false for JBoss 5)struts.convention.action.eagerLoadingfalseIf set, found action classes will be instantiated by the ObjectFactory to accelerate future use, setting it up can clash with Spring managed beans