616 CHAPTER 15 USING STRUTS, XDOCLET, AND
CHAPTER 15 USING STRUTS, XDOCLET, AND OTHER TOOLS 617 The UserCounterController is simply grabbing an attribute out of the application scope and putting it into the request scope. However, you could easily add more complex logic in this method. In this example, you re storing the attribute in the request attribute for simplicity, but it could also be stored in the ComponentContext using the following code: tilesContext.putAttribute(UserCounterListener.COUNT_KEY, userCounter); This would ensure that the attribute was only available for this tile. To configure struts-resume to use this controller, we edited tiles-config.xml file (in web/WEB-INF). We decided we wanted to display this Current Users counter in the header of the page and since we only defined the header in the “baseLayout” definition, this was an easy change. Before the change, the header tile was simply pointing to the header.jsp file:
Note: If you are looking for good and high quality web space to host and run your jsp application check Lunarwebhost jsp web hosting services