/** * Extract {@link org.springframework.web.bind.annotation.RequestMapping}'s list of {@link RequestMethod}s into an * array of {@link String}s. * * @param type * @param method * @return */ @Override public Collection<HttpMethod> getRequestMethod(Class<?> type, Method method) { Assert.notNull(type, "Type must not be null!"); Assert.notNull(method, "Method must not be null!"); Annotation mergedAnnotation = findMergedAnnotation(method, annotationType); Object value = getValue(mergedAnnotation, "method"); RequestMethod[] requestMethods = (RequestMethod[]) value; List<HttpMethod> requestMethodNames = new ArrayList<>(); for (RequestMethod requestMethod : requestMethods) { requestMethodNames.add(HttpMethod.valueOf(requestMethod.toString())); } return requestMethodNames; }
String httpMethod = requestMethod.toString().toLowerCase(); Operation operation = parseMethod(method, requestMethod);
@RequestMapping(method = {GET, PUT, DELETE, PATCH, TRACE, OPTIONS}) public void catchAll() { // if we hit this controller, it's a 405 supportedMethods(Sets.newHashSet(POST.toString())); }
@RequestMapping(method = {PUT, POST, DELETE, PATCH, TRACE, OPTIONS}) public void catchAll() { // if we hit this controller, it's a 405 supportedMethods(Sets.newHashSet(GET.toString())); }
@RequestMapping(method = {GET, PUT, DELETE, PATCH, TRACE, OPTIONS}) public void catchAll() { // if we hit this controller, it's a 405 supportedMethods(Sets.newHashSet(POST.toString())); }
@RequestMapping(method = {PUT, POST, DELETE, PATCH, TRACE, OPTIONS}) public void catchAll() { // if we hit this controller, it's a 405 supportedMethods(Sets.newHashSet(GET.toString())); }
@RequestMapping(method = {GET, PUT, DELETE, PATCH, TRACE, OPTIONS}) public void catchAll() { // if we hit this controller, it's a 405 supportedMethods(Sets.newHashSet(POST.toString())); }
@RequestMapping(method = {PUT, POST, DELETE, PATCH, TRACE, OPTIONS}) public void catchAll() { // if we hit this controller, it's a 405 supportedMethods(Sets.newHashSet(GET.toString())); }
@RequestMapping(method = {PUT, POST, DELETE, PATCH, TRACE, OPTIONS}) public void catchAll() { // if we hit this controller, it's a 405 supportedMethods(Sets.newHashSet(GET.toString())); }
@RequestMapping(method = {PUT, POST, DELETE, PATCH, TRACE, OPTIONS}) public void catchAll() { // if we hit this controller, it's a 405 supportedMethods(Sets.newHashSet(GET.toString())); }
@RequestMapping(method = { PUT, POST, DELETE, PATCH, TRACE, OPTIONS }) public void catchAll() { // if we hit this controller, it's a 405 supportedMethods(Sets.newHashSet(GET.toString())); }
@RequestMapping(method = {PUT, POST, DELETE, PATCH, TRACE, OPTIONS}) public void catchAll() { // if we hit this controller, it's a 405 supportedMethods(Sets.newHashSet(GET.toString())); }
@RequestMapping(method = {PUT, POST, DELETE, PATCH, TRACE, OPTIONS}) public void catchAll() { // if we hit this controller, it's a 405 supportedMethods(Sets.newHashSet(GET.toString())); }
@RequestMapping(method = {GET, PUT, DELETE, PATCH, TRACE, OPTIONS}) public void catchAll() { // if we hit this controller, it's a 405 supportedMethods(Sets.newHashSet(POST.toString())); }
@RequestMapping(method = {PUT, POST, DELETE, PATCH, TRACE, OPTIONS}) public void catchAll() { // if we hit this controller, it's a 405 supportedMethods(Sets.newHashSet(GET.toString())); }
@RequestMapping(method = {GET, PUT, DELETE, PATCH, TRACE, OPTIONS}) public void catchAll() { // if we hit this controller, it's a 405 supportedMethods(Sets.newHashSet(POST.toString())); }
@RequestMapping(method = {GET, POST, DELETE, PATCH, TRACE, OPTIONS}) public void catchAll() { // if we hit this controller, it's a 405 supportedMethods(Sets.newHashSet(PUT.toString())); }
public void addAutoRequestMethod(String path, AutoRequestMethod method) { if (this.autoMehotdMap.get(path) == null) { this.autoMehotdMap.put(path, new ConcurrentHashMap<>()); } this.autoMehotdMap.get(path).put(method.getRequestMapping().method()[0].toString(), method); }