« | August 2025 | » | 日 | 一 | 二 | 三 | 四 | 五 | 六 | | | | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | | | | | | | |
| 公告 |
不得窥道门,不得悟佛门,不得入窄门,实乃破门。 |
Blog信息 |
blog名称:破门点滴 日志总数:161 评论数量:404 留言数量:-2 访问次数:1420871 建立时间:2004年11月13日 |

| |
[开发笔记]Triones Runtime : 对xWork Result 的支持 心得体会, 软件技术 破门 发表于 2005/1/16 22:59:35 |
考虑xWork Result 的支持,以及与Turbine View的连接:
第一步:处理xwork 的result。
根据xwork的扩展方式,在TrionesActionInvocation中覆盖了 createResult方法:
Result createResult() throws Exception {
// 根据Result Name 加载结果
result = (Result) proxy.getConfig().getResults().get(resultCode);
return result;
}
由于在Eclipse环境下类加载方式的不同,因此还必须修订配置方法中有关result的处理。在TrionesActionConfiguration中修订 getTrionesActionConfig方法。
….
// 设置results
HashMap results = new HashMap();
Iterator it = actionInfo.getResults();
while(it.hasNext()) {
TrionesResultInfo resultInfo = (TrionesResultInfo) it.next();
Object result = resultTypes.get(resultInfo.getNamespace() + "." + resultInfo.getType());
// 设置 ResultConfig
ResultConfig resultConfig = new ResultConfig();
// (TrionesResultInfo) resultTypes.get(resultName);
// TODO 需要真正的类名
resultConfig.setClassName(result.getClass().getName());
resultConfig.setName(resultInfo.getName());
// TODO 对Result的 Parameters 支持
resultConfig.setParams(null);
//这里原来按照xwork做法,放入resultConfig对象,但是不能正常处理
//因此暂时改为直接放入 result对象。
results.put(resultInfo.getName(), result);
}
actionConfig.setResults(results); | |
回复:对xWork Result 的支持-运行输出 心得体会, 软件技术 破门发表评论于2005/1/16 23:01:35 |
[Triones] controllerInfo = webwork
[Triones] controllerID = org.softme.triones.runtime.TrionesWebworkController
action= - org.softme.triones.hello.HelloAction2
---Hello by xwork Interceptor!
doHello() --Hello by xWork Action!
---Hello by xwork result!
<br>--Hello by Result!
| |
» 1 »
|