I have successfully used the ModelDriven interface again and again.  But
suddenly, on my most recent action, the model does not find its way to the
top of the stack, and I cannot find where the problem might be.

This is what I know about ModelDriven setup:
1) Action must implement ModelDriven<T> interface.  My latest action does:
there is a getModel() method returning type T, and there is an explicit
declaration of implementation.
2) The model must be not null.  The object returned is indeed not null;  I
test this in the logs.
3) The ModelDrivenInterceptor must be on the interceptor-stack invoked with
the action.  This is the case since this latest action is in the same
package as other actions where ModelDriven works;  moreover, it is plainly
patent that some of the other interceptors in the same interceptor-stack are
properly being invoked.

On the JSP result, I access all the properties I want through
${model.property} but none of the properties work with ${property}.

If I append the parameter debug=xml to the URL, the resulting XML shows that
the ValueStack contains 2 (and not 3) elements:  the Action stack and the
DefaultTextProvider.  With a ModelDriven action, the ValueStack should first
contain the Model (then the ActionStack and then the DefaultTextProvider).

What puzzles more than anything else is that the other actions in the same
package are highly similar: yet these earlier ones do work properly, while
that latest one fails to push the model on top of the stack...

Before I start importing lots of code in this thread, would anyone have
experienced similar puzzling behaviour?
Would anyone have a suggestion as to my best strategy for narrowing down my
problem?  Some debugging or some logging strategy?  Removing this or that
from the code and then testing?

(Using Struts 2.1.2, Spring 2.5, Tiles 2, Tomcat 6.0.16)

Reply via email to