01: /*
02: * Copyright 2002-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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.bind.annotation;
18:
19: import java.lang.annotation.Documented;
20: import java.lang.annotation.ElementType;
21: import java.lang.annotation.Inherited;
22: import java.lang.annotation.Retention;
23: import java.lang.annotation.RetentionPolicy;
24: import java.lang.annotation.Target;
25:
26: /**
27: * Annotation that indicates the session attributes that a specific handler
28: * uses. This will typically list the names of model attributes which should be
29: * transparently stored in the session or some conversational storage,
30: * serving as form-backing beans. <b>Declared at the type level,</b> applying
31: * to the model attributes that the annotated handler class operates on.
32: *
33: * @author Juergen Hoeller
34: * @since 2.5
35: */
36: @Target({ElementType.TYPE})
37: @Retention(RetentionPolicy.RUNTIME)
38: @Inherited
39: @Documented
40: public @interface SessionAttributes {
41:
42: /**
43: * The names of session attributes in the model, to be stored in the
44: * session or some conversational storage.
45: * <p>Note: This indicates the model attribute names. The session attribute
46: * names may or may not match the model attribute names; applications should
47: * not rely on the session attribute names but rather operate on the model only.
48: */
49: String[] value() default {};
50:
51: /**
52: * The types of session attributes in the model, to be stored in the
53: * session or some conversational storage. All model attributes of this
54: * type will be stored in the session, regardless of attribute name.
55: */
56: Class[] types() default {};
57:
58: }
|