Struts2源码深入
来源:互联网 发布:守望先锋 数据查询 编辑:程序博客网 时间:2024/05/18 20:52
public String invoke() throws Exception {
String profileKey = "invoke: ";
try {
UtilTimerStack.push(profileKey);
if (executed) {
throw new IllegalStateException("Action has already executed");
}
if (interceptors.hasNext()) {//递归调用拦截器
final InterceptorMapping interceptor = interceptors.next();
String interceptorMsg = "interceptor: " + interceptor.getName();
UtilTimerStack.push(interceptorMsg);
try {
resultCode = interceptor.getInterceptor().intercept(DefaultActionInvocation.this);
}
finally {
UtilTimerStack.pop(interceptorMsg);
}
} else {
resultCode = invokeActionOnly();//执行action里的指定方法,并得到返回的字符串
}
// this is needed because the result will be executed, then control will return to the Interceptor, which will
// return above and flow through again
if (!executed) {
if (preResultListeners != null) {
for (Object preResultListener : preResultListeners) {
PreResultListener listener = (PreResultListener) preResultListener;
String _profileKey = "preResultListener: ";
try {
UtilTimerStack.push(_profileKey);
listener.beforeResult(this, resultCode);
}
finally {
UtilTimerStack.pop(_profileKey);
}
}
}
// now execute the result, if we're supposed to
if (proxy.getExecuteResult()) {
executeResult();//在这个函数里得到该action方法返回字符串对应要去的页面
}
executed = true;
}
return resultCode;
}
finally {
UtilTimerStack.pop(profileKey);
}
}
String profileKey = "invoke: ";
try {
UtilTimerStack.push(profileKey);
if (executed) {
throw new IllegalStateException("Action has already executed");
}
if (interceptors.hasNext()) {//递归调用拦截器
final InterceptorMapping interceptor = interceptors.next();
String interceptorMsg = "interceptor: " + interceptor.getName();
UtilTimerStack.push(interceptorMsg);
try {
resultCode = interceptor.getInterceptor().intercept(DefaultActionInvocation.this);
}
finally {
UtilTimerStack.pop(interceptorMsg);
}
} else {
resultCode = invokeActionOnly();//执行action里的指定方法,并得到返回的字符串
}
// this is needed because the result will be executed, then control will return to the Interceptor, which will
// return above and flow through again
if (!executed) {
if (preResultListeners != null) {
for (Object preResultListener : preResultListeners) {
PreResultListener listener = (PreResultListener) preResultListener;
String _profileKey = "preResultListener: ";
try {
UtilTimerStack.push(_profileKey);
listener.beforeResult(this, resultCode);
}
finally {
UtilTimerStack.pop(_profileKey);
}
}
}
// now execute the result, if we're supposed to
if (proxy.getExecuteResult()) {
executeResult();//在这个函数里得到该action方法返回字符串对应要去的页面
}
executed = true;
}
return resultCode;
}
finally {
UtilTimerStack.pop(profileKey);
}
}
0 0
- Struts2源码深入
- 深入研究Struts2(二)-StrutsPrepareAndExecuteFilter源码剖析
- 深入研究Struts2(二)-StrutsPrepareAndExecuteFilter源码剖析
- struts2执行流程深入探索-源码分析
- struts 2 深入详解 孙鑫 源码 struts2 深入详解 书上源码 下载列表
- 深入Struts2
- 深入Struts2
- 深入Struts2
- 深入Struts2
- 深入Struts2
- 深入Struts2
- 深入Struts2
- 深入Struts2
- Struts2后缀-深入Struts2
- struts2源码
- Struts2深入详解--- 认识Struts2
- Spring(十一)深入理解spring+struts2整合(附源码)
- struts2.0深入理解
- SVN提交之后补写或改写log信息的方法及错误问题解决
- Hive2 beeline 使用方法
- Mac环境Sublime text2解决中文乱码的问题
- STL空间配置器的union obj
- C++:文件加密(凯撒加密、栅栏加密、异或加密四方加密、Base64加密)
- Struts2源码深入
- USB协通讯议--深入理解
- Android开发如何进阶?(转载)
- 算法学习与代码实现6——快速排序
- 自定义侧拉删除(嵌套ListView)
- 2016年Android实习岗位 腾讯二面+阿里一面
- 简略版ubuntu14.04下安装caffe所遇到的问题解决
- iPhone中使用NSLocalizedString实现国际化
- high bandwidth isoc