Struts源码研究 - Action-Input属性篇 - 编程入门网
作者 佚名技术
来源 NET编程
浏览
657
发布时间 2012-06-15
![]() |
="resources.application"/><!-- ======================================= Plug Ins Configuration --><!-- ========== Tiles plugin =================== --><!-- --><!--This plugin initialize Tiles definition factory. This later can takes someparameters explained here after. The plugin first read parameters from web.xml, thenoverload them with parameters defined here. All parameters are optional.The plugin should be declared in each struts-config file.- definitions-config: (optional)Specify configuration file names. There can be several commaseparated file names (default: ?? )- moduleAware: (optional - struts1.1)Specify if the Tiles definition factory is module aware. If true (default),there will be one factory for each Struts module.If false, there will be one common factory for all module. In this later case,it is still needed to declare one plugin per module. The factory will beinitialized with parameters found in the first initialized plugin (generally theone associated with the default module).true : One factory per module. (default)false : one single shared factory for all modules- definitions-parser-validate: (optional)Specify if xml parser should validate the Tiles configuration file.true : validate. DTD should be specified in file header. (default)false : no validationPaths found in Tiles definitions are relative to the main context.--><!-- comment following if struts1.0.x --><plug-in className="org.apache.struts.tiles.TilesPlugin" ><set-property property="definitions-config"value="/WEB-INF/tiles-defs.xml" /><set-property property="moduleAware" value="true" /><set-property property="definitions-parser-validate" value="true" /></plug-in><!-- end comment if struts1.0.x --><plug-in className="org.apache.struts.validator.ValidatorPlugIn"><set-propertyproperty="pathnames"value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/></plug-in></struts-config>
Struts源码研究 - Action-Input属性篇(2)时间:2011-08-18首先描述一下系统的出错背景: 1、从首页点击链接来到添加用户的页面 正常 2、在添加用户页面中输入Vlidator.xml文件中定义的错误数据,弹出Javascript对话框,提示出错 正常 3、在添加用户页面中输入合法数据,数据保存进入文件并重定向到首页 正常 4、在添加用户页面中输入ActionForm中定义的非法数据,系统应返回到添加用户的页面 出错!!! OK,来着重看这个添加动作的定义,如下: <actionpath="/docreateuser"type="com.zchome.CreateUserAction"name="CreateUserForm"scope="request"input="createuser"><forward name="createusersuccess" path="/jsp/Welcome.jsp"/><forward name="createuser" path="/jsp/createuser.jsp"/></action> 从以上的定义可以看出,如果Validate验证出错,Struts应该为我们重定向到input域所定义的uri,即/jsp/createuser.jsp看起来应该没有问 |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
关于Struts源码研究 - Action-Input属性篇 - 编程入门网的所有评论