Convention plugin confusion

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Convention plugin confusion

B.L. Zeebub

I'm returning to Struts after a long absence and I'm confused by the behaviour of the convention plugin. I have a class named IndexAction with a two methods, the standard "execute()" method and my own getDetails() method which was being called using dynamicMethodInvocation. The getDetails() method returns a string of "details" and I have a jsp named index-details.jsp. Config-browser confirms the mapping has been done and calls to the getDetails() method behaves as expected.

I then removed the dynamicMethodInvocation and replaced it with a call to the url "fetchdetails" which I mapped in my IndexAction class using @Action("fetchdetails") for the getDetails() method. Now when I click the link, I get a Struts 2 error "No result defined for action <packagename>.IndexAction and result details although the file index-details.jsp is still present and configbrowser confirms that the mapping is recognised.

Configbrowser also shows that as a result of the @Action annotation I now have another action "fetchdetails" in my application and if I rename index-details.jsp to fetchdetails-details.jsp everything now works as expected.

Is this as it should be and, if so, why does Struts issue the misleading message? Alternatively, how do I set things up so that the result is found on the containing class IndexAction as Struts wants?