I have a web application in Struts and Hibernate that is working correctly.
We are also on the app development, and we are planning to configure both RESTful web services and web application URLs in one single struts.xml.
For web application the parent package should be
<constant name="struts.convention.default.parent.package" value="struts2"/>
But for writing the web services they are saying like the parent package should be write like this
<constant name="struts.convention.default.parent.package" value="rest-default" />
How can I accommodate both the parent package to make the web application and the web services working together ?
Also, what all other configuration I need to add to write RESTful webservices using Struts2 ?
My updated struts.xml is
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="myActionMapper" class="org.apache.struts2.rest.example.CustomActionMapper" />
<constant name="struts.mapper.class" value="myActionMapper" />
<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="example"/>
<constant name="struts.action.extension" value="xhtml,,xml,json,action"/>
It is also not working. The actions are working clearly in this case. but the web services are not working.