@Controller("/UserAction")
@RequestMapping("/greet.json")
public class UserAction extends BaseAction {
@RequestMapping(value = "/hello", method = RequestMethod.GET)
public void hello(HttpServletRequest request,HttpServletResponse response) {
System.out.println("a");
}
@RequestMapping(value = "/word", method = RequestMethod.GET)
public void word(HttpServletRequest request,HttpServletResponse response) {
System.out.println("123123@@@");
}
}
http://localhost:8080/ProjectName/ greet.json /hello とhttp://localhost:8080/ProjectName/greet.json/word を見ると、syso メソッドを実行できません
AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,businessService,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0,txAdvice,org.springframework.context.annotation. ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; ファクトリ階層のルート 08:33:38,490 ERROR [org.springframework.web.servlet.DispatcherServlet] (org.springframework.web.servlet.FrameworkServlet:460) - コンテキストの初期化に失敗しました org.springframework.beans.factory.BeanCreationException: 作成中にエラーが発生しましたServletContext リソース [/WEB-INF/web-config.xml] で定義された「org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0」という名前の Bean: init メソッドの呼び出しに失敗しました。ネストされた例外は java. lang.IllegalStateException: あいまいなマッピングが見つかりました。'userAction' Bean メソッド public void cn.elfsoft.controller.UserAction.word(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) を {[/greet.json],methods=[],params にマップできません=[],headers=[],consumes=[],produces=[],custom=[]}: 既に 'userAction' Bean メソッド public void cn.elfsoft.controller.UserAction.hello(javax.servlet.http) があります.HttpServletRequest,javax.servlet.http.HttpServletResponse) がマッピングされます。