26abdbdb47dcd7203c642f180091bc58426e7d10
[percentcodec] / accelerator-examples / spring / src / main / webapp / WEB-INF / views / controller-view.jsp
1 <%@page contentType="text/html" pageEncoding="UTF-8" session="false" buffer="1kb" %>
2 <%@page import="java.util.Map" %>
3 <%@page import="java.util.Date"%>
4 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5
6 <html>
7   <head>
8     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
9     <title>Page, that is handled by a controller</title>
10   </head>
11   <body>
12     <% Map<Date,String> requests = (Map<Date,String>)request.getAttribute("requests");
13        if (requests == null) { %>
14     <h1 style="color: red">This page associated with a controller and should be viewed as such!</h1>
15     <p style="color: red">Go to: <a href="/spring-controller.html">/spring-controller.html</a></p>
16     <% } else { %>
17     <h1>Controlled Page</h1>
18     <form action="/spring-controller.html">
19       <label for="max-age">Max Age:</label>
20       <input type="text" name="max-age" value="<% if (request.getParameter("max-age") != null) { %><%= request.getParameter("max-age") %><% } %>" />
21       <br />
22     </form>
23     <p>(Uncached) requests so far:</p>
24     <ol>
25       <% for(Map.Entry<Date,String> entry : requests.entrySet()) { %>
26       <li>
27         <%= entry.getKey() %>:
28         <% if (entry.getValue().equals("")) { %>
29           <a href="/spring-controller.html">No parameters...</a>
30         <% } else { %>
31           <a href="/spring-controller.html?<%= entry.getValue() %>">
32             <% for (String parameter : entry.getValue().split("&")) { %>
33             <strong><%= parameter %></strong>
34             <% } %>
35           </a>
36         <% } %>
37       </li>
38       <% } %>
39     </ol>
40     <% } %>
41     <p>This page was delivered via SPRING!</p>
42   </body>
43 </html>