首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

相关Struts2何时检测到action是否存在

2012-09-21 
有关Struts2何时检测到action是否存在在org.apache.struts2.dispatcher包中的Dispatcher这个调度器类中,有

有关Struts2何时检测到action是否存在
在org.apache.struts2.dispatcher包中的Dispatcher这个调度器类中,有这么一段代码:

 String namespace = mapping.getNamespace(); String name = mapping.getName(); String method = mapping.getMethod(); Configuration config = configurationManager.getConfiguration(); ActionProxy proxy = config.getContainer().getInstance(ActionProxyFactory.class).createActionProxy(namespace, name, method, extraContext, true, false);


先是将mapping中的请求路径信息解析出来,然后获取config(首先要保证访问的是action,才能获取到),接着是执行createActionProxy这个方法,如果找到了对应的action,则会继续往下执行,如果没有找到,则会出现一个ConfigurationException的异常,Console端会输出Could not find action or result
There is no Action mapped for……

热点排行