KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > web > servlet > mvc > multiaction > NoSuchRequestHandlingMethodException


1 /*
2  * Copyright 2002-2006 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.springframework.web.servlet.mvc.multiaction;
18
19 import javax.servlet.ServletException JavaDoc;
20 import javax.servlet.http.HttpServletRequest JavaDoc;
21
22 /**
23  * Exception thrown when there's no request handling method for a request.
24  *
25  * @author Rod Johnson
26  * @author Juergen Hoeller
27  */

28 public class NoSuchRequestHandlingMethodException extends ServletException JavaDoc {
29
30     private String JavaDoc methodName;
31
32
33     /**
34      * Create a new NoSuchRequestHandlingMethodException for the given request.
35      * @param request the offending HTTP request
36      */

37     public NoSuchRequestHandlingMethodException(HttpServletRequest JavaDoc request) {
38         super("No handling method can be found for request [" + request + "]");
39     }
40     
41     /**
42      * Create a new NoSuchRequestHandlingMethodException for the given request.
43      * @param methodName the name of the handler method that wasn't found
44      * @param controllerClass the class the handler method was expected to be in
45      */

46     public NoSuchRequestHandlingMethodException(String JavaDoc methodName, Class JavaDoc controllerClass) {
47         super("No request handling method with name '" + methodName +
48                 "' in class [" + controllerClass.getName() + "]");
49         this.methodName = methodName;
50     }
51
52
53     /**
54      * Return the name of the offending method, if known.
55      */

56     public String JavaDoc getMethodName() {
57         return methodName;
58     }
59
60 }
61
Popular Tags