1 18 19 package org.apache.struts.webapp.tiles.test; 20 21 import java.io.IOException ; 22 23 import javax.servlet.ServletContext ; 24 import javax.servlet.ServletException ; 25 import javax.servlet.http.HttpServletRequest ; 26 import javax.servlet.http.HttpServletResponse ; 27 28 import org.apache.struts.tiles.ComponentContext; 29 import org.apache.struts.tiles.ControllerSupport; 30 31 32 36 public class TestTileController extends ControllerSupport 37 { 38 39 public TestTileController() 40 { 41 } 42 43 50 public void perform(ComponentContext tileContext, 51 HttpServletRequest request, HttpServletResponse response, 52 ServletContext servletContext) 53 throws ServletException , IOException 54 { 55 System.out.println( "Controller called" ); 56 57 58 String title = (String )tileContext.getAttribute("title"); 59 title += "- controller called"; 60 tileContext.putAttribute( "title", title); 61 } 62 63 64 } 65 | Popular Tags |