I'm new in struts2, I tried to use Restful but I can't config.
I have 2 Controllers:
UsersController
@Namespace("/api")
public class UsersController extends ActionSupport implements ModelDriven<Object> {
}
ListController
@Namespace("/api/users/{user_id}")
public class ListController extends ActionSupport implements ModelDriven<Object> {
}
I would like to create API like this:
/api/users/ -> method UsersController.index
/api/users/{user_id} -> method UsersController.show
/api/users/{users_id}/list -> method ListController.index
/api/users/{users_id}/list/{list_id} -> method ListController.show
I tried config struts.properties
struts.devMode = true
struts.convention.action.suffix = Controller
struts.convention.action.mapAllMatches = true
struts.convention.default.parent.package = rest-default
struts.convention.package.locators = controller
struts.rest.defaultExtension = json
struts.action.extension =
struts.mapper.alwaysSelectFullNamespace = false
struts.mapper.idParameterName = id
struts.patternMatcher = namedVariable
struts.mapper.class = org.apache.struts2.dispatcher.mapper.Restful2ActionMapper
struts.enable.SlashesInActionNames = true
It doesn't work like what I want.
Do you have any suggestion?