public abstract interface org.apache.struts2.dispatcher.mapper.ActionMapper {} public abstract org.apache.struts2.dispatcher.mapper.ActionMapping getMapping(javax.servlet.http.HttpServletRequest arg0, com.opensymphony.xwork2.config.ConfigurationManager arg1); public abstract org.apache.struts2.dispatcher.mapper.ActionMapping getMappingFromActionName(java.lang.String arg0); public abstract java.lang.String getUriFromActionMapping(org.apache.struts2.dispatcher.mapper.ActionMapping arg0); http请求,进入ActionContextCleanup(session,Attribute保留),走一些过滤器,filter,然后进入struts2 FilterDispatcher 然后进入ActionMapper,这个是用来判断请求是否 需要struts2处理,如果需要,那么由ActionProxy来接管,通过配置管理我们可以找到我们的struts.xml,然后进入真正做事的Action Invocation,依次穿过我们的拦截器,进入action,从而根据返回的result选择我们要的页面,在拦截器的前半部分去值栈中取值通过标签展示在页面上,最后生成response返回
ActionMapper 是干什么用的?
Struts2 请求处理流程
最新推荐文章于 2021-04-14 12:33:42 发布
本文介绍了Struts2框架中的请求处理流程,包括ActionMapper的角色及其如何决定请求是否由Struts2处理,从配置文件中查找对应的Action,以及如何通过拦截器调用真正的Action并返回结果。
1642

被折叠的 条评论
为什么被折叠?



