在处理使用ModelDriven接口的过程中,我一直简单的以为,FilterDispatcher的处理是:请求--Dispatcher-------action--interceptor--Dispatcher返回用户请求的界面,但是实际上并不是这样的!
这个过程就是,在我自定义一个interceptor时发现的,具体的处理流程应该是:
请求-----------dispatcher----------DefaultInvocation(这一步就算是上面指的 Interceptor)---------Interceptors(run as the order they applyed)---------------action---------dispatcher---------result(This is an Result object and if there is not some PreListener object ,this result Object will doExecute before the Interceptor object)-----------Interceptor----------DefaultInvocation
This is really a great process for running order!!!!!!!!
最大的问题是,在这个过程中对valueStack的处理是影响非常大的,ValueStack并不是简单的作为一个传递数据的工具,处理页面标签的过程,可以从ValueStack和ActioncontextMap两个地方进行查找!!
其实,jsp页面的struts2标签对象主要还是从ValueStack中进行后台的数据抽取,只不过查询时是先查找这个指定的名称是否存在,不存在就查找是否在ValueStack的保存的对象中!
责任编辑:小草