ActionMapper 是干什么用的?

来源:互联网 发布:模板装修辅助工具源码 编辑:程序博客网 时间:2024/04/28 05:23
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,然后进入真正做事的ActionInvocation,依次穿过我们的拦截器,进入action,从而根据返回的result选择我们要的页面,在拦截器的前半部分去值栈中取值通过标签展示在页面上,最后生成response返回
0 0
原创粉丝点击