私は struts2 の初心者です。Restful を使用しようとしましたが、構成できません。
私は2つのコントローラーを持っています:
ユーザーコントローラー
@Namespace("/api")
public class UsersController extends ActionSupport implements ModelDriven<Object> {
}
ListController
@Namespace("/api/users/{user_id}")
public class ListController extends ActionSupport implements ModelDriven<Object> {
}
次のような API を作成したいと思います。
/api/users/ -> メソッド UsersController.index
/api/users/{user_id} -> メソッド UsersController.show
/api/users/{users_id}/list -> メソッド ListController.index
/api/users/{users_id}/list/{list_id} -> メソッド ListController.show
構成 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
それは私が望むようには機能しません。
何か提案はありますか?