|
|
|
[
Permlink
| « Hide
]
Simone Bordet - [25/Nov/04 10:18 AM ]
The problem shows also with using <jsp:include ... /> tag, not only with <ww:include ... />.
Jason,
here's the result of my findings: 1. The OgnlValueStack is recreated new on each include. This is not good since it must keep track of the enclosing action. The reason is that in ServletDispatcher.serveAction() the value stack is not passed into the extraContext map, and therefore (down the invacations) DefaultActionInvocation.createContextMap() creates it every time. 2. The action is pushed into the value stack in DefaultActionInvocation.init(), but never popped out of it. The best place I've found to pop the action is in a finally block that wraps proxy.execute() in ServletDispatcher.serviceAction(). See attached file. 3. I recommend not to use static methods in ServletDispatcher, as it can be subclassed. For example, make createContextMap() non static and move the implementation into a utility method somewhere else (that can be static). This way createContextMap() can be overridden, and new stuff added to the map, if the user wants so. Right now is impossible. 4. There is a reason to put the value stack in the request ? It is used only in few places, e.g. TagUtils.getStack(), which is IMHO better replaced by ActionContext.getContext().getValueStack(), like the other 95% of the code. 4. Finally I attach a modified version of ServletDispatcher that solves the issue, but I'm not sure if it breaks others (for what I can say, it seems to work fine, but then I'm only using JSP as views). Thanks a lot, Simon I think this broke my setup (I'm using velocity).
The vm: 0: $stack.findValue('[0]')<br> 1: $stack.findValue('[1]')<br> #includeservlet('listShipmentTabs.action') 0: $stack.findValue('[0]')<br> 1: $stack.findValue('[1]')<br> Output: 0: [com.transbility.web.action.ShipmentStatusAction@14e70f2] 1: [] <included action output> 0: [com.transbility.web.action.ShipmentStatusAction@14e70f2] 1: [] The output is the same, using xw-1.0.4/ww-2.1.6 or xw-1.0.5/ww-2.1.7, but the behaviour is still different. In the browseShipmentStatus, a list of statuses is created and displayed. The hole list of statuses is sent back to the action class, modified and displayed again. The problem is that the properties that were modified in the action are overwritten by the values in the form. If I don't include the listShipmentTabs.action, all is fine, but If I do, it seems that the parameters that are set on it override the ones in the parent action also. Andrei,
I don't understand the issue... Can you give more detail? Either send a note to the mailing list (dev@webwork.dev.java.net) or create a new Jira issue. | ||||||||||||||||||||||||||||||||||||||||||||||