浏览 5164 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2005-04-07
但是用Filter, 得到response内容都是空 谢谢。 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2005-04-07
我觉得可以自己写一个servletdispatcher,继承webwork2自带的那个。
|
|
返回顶楼 | |
发表时间:2005-04-08
用webwork的interceptor实现了。
|
|
返回顶楼 | |
发表时间:2005-04-08
很有必要吗?出了错转到error不久得了
|
|
返回顶楼 | |
发表时间:2005-04-08
不妨参考jert的做法,用一个拦截器。
|
|
返回顶楼 | |
发表时间:2005-04-10
jert拦截器
|
|
返回顶楼 | |
发表时间:2005-04-13
public class ExceptionInterceptor implements Interceptor {
private static Logger log = Logger.getLogger(ExceptionInterceptor.class); public static final String EXCEPTION = "exception"; public String intercept(ActionInvocation invocation) throws Exception { try { return invocation.invoke(); } catch (Exception e) { String message = "Caught exception while invoking action: " + invocation.getAction(); log.error(message, e); StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); invocation.getInvocationContext().put("_exception_message_", e.getMessage()); invocation.getInvocationContext().put("_exception_more_detail_", sw.toString()); return EXCEPTION; } } public void destroy() { } public void init() { } } |
|
返回顶楼 | |
发表时间:2005-04-27
谢谢兄弟。只是,这个。。。。我不是很明白啊,呵呵。
就是我现在有个interceptor 了,现在我要做的是: 再加你这个interceptor? 这样的话,新的interceptor 能catch到就的interceptor的exception 吗? 还是说,现在我的interceptor 按照你的interceptor 的结构,做些修改? ----------------------------- 还有, 我按照你的结构,修改我的interceptor。如下: ......... invocation.getInvocationContext().put("_exception_message_", e.getMessage()); invocation.getInvocationContext().put("_exception_more_detail_", sw.toString()); return EXCEPTION; 能成功地dispatch到知道的页面, 但是jsp页面如何取出"_exception_message_"的数据啊? 我用<ww:property value="_exception_message_" />不行啊。。 |
|
返回顶楼 | |