KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > web > servlet > handler > metadata > PathMap


1 /*
2  * Copyright 2002-2005 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.handler.metadata;
18
19 /**
20  * Attribute to be used on Controller classes to allow for automatic URL mapping
21  * without web controllers being defined as beans in an XML bean definition file.
22  *
23  * <p>The path map should be the path in the current application, such as /foo.cgi.
24  * If there is no leading "/", one will be prepended.
25  *
26  * <p>Application code must use the Commons Attributes indexer tool to use this option.
27  *
28  * @author Rod Johnson
29  * @@org.apache.commons.attributes.Indexed()
30  */

31 public class PathMap {
32     
33     /*
34      * NB: The Indexed attribute on this class is required. Thus the Spring jar
35      * must be built including a Commons Attributes attribute compilation step
36      * for this class.
37      */

38     
39     private final String JavaDoc url;
40
41     /**
42      * Create a new PathMap attribute for the given URL.
43      */

44     public PathMap(String JavaDoc url) {
45         this.url = url;
46     }
47
48     /**
49      * Return the URL that this attribute indicates.
50      */

51     public String JavaDoc getUrl() {
52         return url;
53     }
54
55 }
56
Popular Tags