私は2つのエンドポイントしか定義されていないスプリングブートアプリケーションを持っています。春のブート時に "/"への直接アクセスを削除する
@RequestMapping(value = "/getAllFeatures", method = RequestMethod.GET)
@Cacheable("features")
public ResponseEntity<?> getAllFeatures() {
...
}
@RequestMapping(name = "/getFeatureStatus", method = RequestMethod.GET)
@Cacheable("features")
public ResponseEntity<?> getFeatureStatus(@RequestParam(value = "groupName", required = false) String groupName,
@RequestParam(value = "featureName", required = false) String featureName) {
...
}
と私はserver.contextパスするコンテキストを定義している=/ABCのI/ABC /上GET呼び出しを行うときに問題があるどのように
アプリケーションは私に有効な応答を提供します。どこで私は決して "/"私の残りのコントローラにマップされていません。リクエストを "/"にブロックする方法に関するアイデア。また、このアプリケーションはどんな種類のスプリングセキュリティも必要としません。
'org.springframework.beans.factory.BeanCreationException:クラスパスリソース[org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration $ EnableWebMvcConfiguration.class]で定義された 'requestMappingHandlerMapping'という名前のBeanを作成中にエラーが発生しました: ;ネストされた例外はjava.lang.IllegalStateException:あいまいなマッピングです。 'featuresController'メソッドをマップできません public org.springframework.http.ResponseEntity > com.util.controller.FeaturesController.getAllFeatures() to {[]、methods = [GET]}:既に 'featuresController' beanメソッドがあります – Rohit
私は上記の例外を受け取ります – Rohit
両方のメソッドのコードを変更しましたか? – RSingh