KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > examples > app4 > MyTileController


1 /*
2  * Copyright 2004 The Apache Software Foundation.
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  * $Id: MyTileController.java,v 1.2 2004/02/20 12:42:53 marino Exp $
17  */

18
19 package examples.app4;
20
21 import org.apache.struts.tiles.Controller;
22 import org.apache.struts.tiles.ComponentContext;
23 import javax.servlet.http.HttpServletRequest JavaDoc;
24 import javax.servlet.http.HttpServletResponse JavaDoc;
25 import javax.servlet.ServletContext JavaDoc;
26 import javax.servlet.ServletException JavaDoc;
27 import java.io.IOException JavaDoc;
28
29 /**
30  * <p>A simple tile-controller that puts a string into the request scope.
31 * Check out the tiles-defs to see the definition that uses the controller</p>
32  *
33  * @author <a HREF="mailto:marinoj@centrum.is"/>Marinó A. Jónsson</a>
34  * @version $Id: MyTileController.java,v 1.2 2004/02/20 12:42:53 marino Exp $
35  */

36
37 public class MyTileController implements Controller {
38
39     public MyTileController() {
40     }
41
42     public void perform(ComponentContext tileContext,
43                         HttpServletRequest JavaDoc request,
44                         HttpServletResponse JavaDoc response,
45                         ServletContext JavaDoc servletContext)
46         throws ServletException JavaDoc, IOException JavaDoc {
47
48         request.setAttribute("foo", "bar");
49     }
50
51 }
52
Popular Tags