001/* 002 * Copyright 2002-2012 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.web.servlet.mvc.multiaction; 018 019import javax.servlet.http.HttpServletRequest; 020 021/** 022 * Interface that parameterizes the MultiActionController class 023 * using the <b>Strategy</b> GoF Design pattern, allowing 024 * the mapping from incoming request to handler method name 025 * to be varied without affecting other application code. 026 * 027 * <p>Illustrates how delegation can be more flexible than subclassing. 028 * 029 * @author Rod Johnson 030 * @see MultiActionController#setMethodNameResolver 031 * @deprecated as of 4.3, in favor of annotation-driven handler methods 032 */ 033@Deprecated 034public interface MethodNameResolver { 035 036 /** 037 * Return a method name that can handle this request. Such 038 * mappings are typically, but not necessarily, based on URL. 039 * @param request current HTTP request 040 * @return a method name that can handle this request. 041 * Never returns {@code null}; throws exception if not resolvable. 042 * @throws NoSuchRequestHandlingMethodException if no handler method 043 * can be found for the given request 044 */ 045 String getHandlerMethodName(HttpServletRequest request) throws NoSuchRequestHandlingMethodException; 046 047}