-webwork.propertiesWebwork属性配置文件。Webwork有个缺省的属性配置文件default.properties,在webwork.jar文件中,你可以建立一个webwork.properties文件重新设置相关属性,相同属性的设置webwork.properties将覆盖default.properties的设置。下面是个default.properties内容,对其中属性作点说明:###国别区域设置中国就设为zh_CNwebwork.locale=en_US###指定Webwork2采用哪个解析器解析以multipart/form-data发送的Http请求#webwork.multipart.parser=coswebwork.multipart.parser=pell#设置Servlet上下文临时文件目录位置及上传文件大小的最大值#如果没有指定saveDir,将使用容器的临时目录webwork.multipart.saveDir=webwork.multipart.maxSize=2097152###Loadcustompropertyfiles(doesnotoverridewebwork.properties!)webwork.custom.properties=application,com/webwork/extension/custom#Action的后缀名称webwork.action.extension=action#标准UI主题,用于定义缺省主题模板在哪个位置,相对于/webwork.ui.theme=xhtmlwebwork.ui.templateDir=template###设置当xwork.xml文件发生改变时是否重新载入webwork.configuration.xml.reload=false###指定velocity模板引擎的属性文件webwork.velocity.configfile=velocity.properties###链到WebWorkVelocityContext的VelocityContext类名列表,用逗号分割webwork.velocity.contexts=-webwork-default.xmlwebwork-default.xml包含在webwork.jar中,是一个基本配置文件,里面配置了标准的ResultType、Interceptors以及两个interceptorsstacksdefaultStack和validationWorkflowStack,可以Include到xwork.xml文件直接使用而不必进行Copy。如:!DOCTYPExworkPUBLIC-//OpenSymphonyGroup//XWork1.0//EN=webwork-default.xml/packagename=defaultextends=webwork-default.../package/xwork下面是Webwork2.1的webwork-default.xml文件内容:!DOCTYPExworkPUBLIC-//OpenSymphonyGroup//XWork1.0//EN=webwork-defaultresult-typesresult-typename=dispatcherclass=com.opensymphony.webwork.dispatcher.ServletDispatcherResultdefault=true/result-typename=redirectclass=com.opensymphony.webwork.dispatcher.ServletRedirectResult/result-typename=velocityclass=com.opensymphony.webwork.dispatcher.VelocityResult/result-typename=chainclass=com.opensymphony.xwork.ActionChainResult/result-typename=xsltclass=com.opensymphony.webwork.views.xslt.XSLTResult/result-typename=jasperclass=com.opensymphony.webwork.views.jasperreports.JasperReportsResult/result-typename=freemarkerclass=com.opensymphony.webwork.views.freemarker.FreemarkerResult//result-typesinterceptorsinterceptorname=timerclass=com.opensymphony.xwork.interceptor.TimerInterceptor/interceptorname=loggerclass=com.opensymphony.xwork.interceptor.LoggingInterceptor/interceptorname=chainclass=com.opensymphony.xwork.interceptor.ChainingInterceptor/interceptorname=static-paramsclass=com.opensymphony.xwork.interceptor.StaticParametersInterceptor/interceptorname=paramsclass=com.opensymphony.xwork.interceptor.ParametersInterceptor/interceptorname=model-drivenclass=com.opensymphony.xwork.interceptor.ModelDrivenInterceptor/interceptorname=componentclass=com.opensymphony.xwork.interceptor.component.ComponentInterceptor/interceptorname=tokenclass=com.opensymphony.webwork.interceptor.TokenInterceptor/interceptorname=token-sessionclass=com.opensymphony.webwork.interceptor.TokenSessionStoreInterceptor/interceptorname=validationclass=com.opensymphony.xwork.validator.ValidationInterceptor/interceptorname=workflowclass=com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor/interceptorname=servlet-configclass=com.opensymphony.webwork.interceptor.ServletConfigInterceptor/interceptorname=prepareclass=com.opensymphony.xwork.interceptor.PrepareInterceptor/interceptorname=conversionErrorclass=com.opensymphony.webwork.interceptor.WebWorkConversionErrorInterceptor/interceptor-stackname=defaultStackinterceptor-refname=static-params/interceptor-refname=params/interceptor-refname=conversionError//interceptor-stackinterceptor-stackname=validationWorkflowStackinterceptor-refname=defaultStack/interceptor-refname=validation/interceptor-refname=workflow//interceptor-stack/interceptors/package/xwork-validators.xmlWebwork2的验证完全利用XWork的验证框架,用于Action执行前的输入数据验证。Validators应用前首先要进行注册,由于XWork的ValidatorFactory完成这项工作。在程序中可以用ValidatorFactory.registerValiator(Stringname,StringclassName)静态方法进行Validator的注册;或者将Validator.xml文件放在/WEB-INF/classes下,其内容如下:validatorsvalidatorname=requiredclass=com.opensymphony.xwork.validator.validators.RequiredFieldValidator/validatorname=requiredstringclass=com.opensymphony.xwork.validator.validators.RequiredStringValidator/validatorname=intclass=com.opensymphony.xwork.validator.validators.IntRangeFieldValidator/validatorname=dateclass=com.opensymphony.xwork.validator.validators.DateRangeFieldValidator/validatorname=expressionclass=com.opensymphony.xwork.validator.validators.ExpressionValidator/validatorname=fieldexpressionclass=com.opensymphony.xwork.validator.validators.FieldExpressionValidator/validatorname=emailclass=com.opensymphony.xwork.validator.validators.EmailValidator/validatorname=urlclass=com.opensymphony.xwork.validator.validators.URLValidator/validatorname=visitorclass=com.opensymphony.xwork.validator.validators.VisitorFieldValidator/validatorname=conversionclass=com.opensymphony.xwork.validator.validators