WebWork 2 : 结果
This page last changed on Dec 13, 2004 by casey.
综述结果是活动返回的字符串常量, 表述活动的执行情况. WebWork缺省定义了一个标准结果集: error, input, login, none and success. 当然, 开发着可以只有的定义自己的结果以表述其他应用状态. 结果使用名值对的结构映射到结果类型.Result元素String SUCCESS = "success"; String NONE = "none"; String ERROR = "error"; String INPUT = "input"; String LOGIN = "login"; <result name="success" type="dispatcher"> <param name="location">/thank_you.jsp</param> </result> ERROR将前进到错误页面, 或前一个页面; <result name="error" type="dispatcher"> <param name="location">/error.jsp</param> </result> <action name="bar" class="myPackage.barAction"> <result name="success" type="dispatcher"> <param name="location">foo.jsp</param> </result> </action> 或更简单 <action name="bar" class="myPackage.barAction"> <result name="success" type="dispatcher">foo.jsp</result> </action> |
Document generated by Confluence on Dec 14, 2004 16:36 |