KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > web > HttpRequestMethodNotSupportedException


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;
18
19 import javax.servlet.ServletException JavaDoc;
20
21 /**
22  * Exception thrown when a request handler does not support a
23  * specific request method.
24  *
25  * @author Juergen Hoeller
26  * @since 2.0
27  */

28 public class HttpRequestMethodNotSupportedException extends ServletException JavaDoc {
29
30     private String JavaDoc method;
31
32
33     /**
34      * Create a new HttpRequestMethodNotSupportedException.
35      * @param method the unsupported HTTP request method
36      */

37     public HttpRequestMethodNotSupportedException(String JavaDoc method) {
38         this(method, "Request method '" + method + "' not supported");
39     }
40
41     /**
42      * Create a new HttpRequestMethodNotSupportedException.
43      * @param method the unsupported HTTP request method
44      * @param msg the detail message
45      */

46     public HttpRequestMethodNotSupportedException(String JavaDoc method, String JavaDoc msg) {
47         super(msg);
48         this.method = method;
49     }
50
51
52     /**
53      * Return the HTTP request method that caused the failure.
54      */

55     public String JavaDoc getMethod() {
56         return method;
57     }
58
59 }
60
Popular Tags