KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > projector > store > RequestAttributeStore


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

20 package org.apache.slide.projector.store;
21
22 import javax.servlet.http.HttpServletRequest JavaDoc;
23
24 public class RequestAttributeStore extends AbstractStore {
25     protected HttpServletRequest JavaDoc request;
26
27     public RequestAttributeStore(HttpServletRequest JavaDoc request) {
28         this.request = request;
29     }
30
31     public void put(String JavaDoc key, Object JavaDoc value) {
32         request.setAttribute(key, value);
33     }
34
35     public Object JavaDoc get(String JavaDoc key) {
36         return request.getAttribute(key);
37     }
38
39     public void dispose(String JavaDoc key) {
40         request.removeAttribute(key);
41     }
42 }
Popular Tags