[ Team LiB ] |
![]() ![]() |
Recipe 18.5 Automatically Refreshing a JSPProblemYou want to refresh a JSP request at a specified interval. SolutionUse a JSP scriptlet that adds a Refresh response header to the response. DiscussionThe following scriptlet code adds a Refresh header that specifies a 60-second interval for refreshing the JSP. Place this code at the top of the JSP before any content appears: <% response.addHeader("Refresh","60"); %>
See AlsoExample 18-6 in Recipe 18.4 on refreshing a servlet; Example 18-7 in Recipe 18.4 on limiting the number of automatic refreshes of a servlet; Recipe 18.1 and Recipe 18.2 on examining request headers in a servlet and a JSP, respectively; Recipe 18.3 on using a filter to wrap the request and forward it along the filter chain; Recipe 18.6 on using a listener to track requests. ![]() |
[ Team LiB ] |
![]() ![]() |