First, I would suggest putting your actions in a package, simply called struts, I had much less configuration problems using the standard architecture of conditional plugins. Move your actions to a package, for example:
uk.co.ratedpeople.struts
instead
uk.co.ratedpeople.tp;
The fewer the settings, the better. It also eliminates the need for this:
<constant name="struts.convention.package.locators" value="tp"/>
Secondly, part of your problem is related to your xml configuration:
<struts> <constant name="struts.devMode" value="true" /> <constant name="struts.mapper.class" value="rest" /> <constant name="struts.convention.action.suffix" value="Controller"/> <constant name="struts.convention.action.mapAllMatches" value="true"/> <constant name="struts.convention.default.parent.package" value="rest-default"/> <constant name="struts.convention.package.locators" value="tp"/> <package name="tradesman" namespace="/beta/tradesman" extends="default"> <result-types> <result-type name="json" class="org.apache.struts2.json.JSONResult"/> <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" /> </result-types> <interceptors> <interceptor name="json" class="org.apache.struts2.json.JSONInterceptor"/> </interceptors> </package>
Try something like this (assuming you rescheduled your actions as suggested earlier):
<struts> <constant name="struts.devMode" value="true" /> <constant name="struts.mapper.class" value="rest" /> <constant name="struts.convention.action.suffix" value="Controller"/> <constant name="struts.convention.action.mapAllMatches" value="true"/> <constant name="struts.convention.default.parent.package" value="tradesman"/> <package name="tradesman" namespace="/beta/tradesman" extends="rest-default"> <result-types> <result-type name="json" class="org.apache.struts2.json.JSONResult"/> <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" /> </result-types> </package> </struts>
Note the constant name = "struts.convention.default.parent.package" value = "tradesman", which refers to the package below it that defines your result types and extends rest-default. This should eliminate the errors in determining the result of the tile.
I also ran into problems using the struts filter that you have in your web.xml, I would change from:
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
in
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
source share