/[projects]/android/TrainInfoService/WebContent/ViewDepartures.jsp
ViewVC logotype

Diff of /android/TrainInfoService/WebContent/ViewDepartures.jsp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 584 by torben, Fri Sep 11 05:32:04 2009 UTC revision 585 by torben, Fri Feb 5 19:15:12 2010 UTC
# Line 2  Line 2 
2      pageEncoding="ISO-8859-1"%>      pageEncoding="ISO-8859-1"%>
3  <%@ page import="java.util.List" %>  <%@ page import="java.util.List" %>
4  <%@ page import="dk.thoerup.traininfoservice.banedk.DepartureBean" %>  <%@ page import="dk.thoerup.traininfoservice.banedk.DepartureBean" %>
5  <%  <%@ taglib uri="http://java.sun.com/jstl/core"    prefix="c" %>
6  String stationname = (String) request.getAttribute("stationname");  <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt" %>
 List<DepartureBean> departurebeans = (List<DepartureBean>) request.getAttribute("departurebeans");  
 int stationID = (Integer) request.getAttribute("stationID");  
 boolean advanced = false;  
 String advStr = request.getParameter("advanced");  
7    
8    <c-rt:set var="advanced" value="<%=request.getAttribute("advanced")%>"/>
9  if (advStr != null) {  <c-rt:set var="stationname" value="<%= request.getAttribute("stationname")%>"/>
10          advanced = Boolean.parseBoolean(advStr);  <c-rt:set var="departurebeans" value="<%= request.getAttribute("departurebeans") %>"/>
11  }  <c-rt:set var="stationID" value="<%= request.getAttribute("stationID") %>"/>
   
   
 %>  
12    
13  <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">  <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
14  <html>  <html>
15  <head>  <head>
16  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
17  <title>Train info : <%= stationname %></title>  <title>Train info : ${stationname}</title>
18  </head>  </head>
19  <body>  <body>
20    
21  <h2>Station: <%= stationname %></h2>  <h2>Station: ${stationname} </h2>
22  <a href="DepartureServlet?station=<%=stationID%>&format=html&advanced=<%= !advanced %>">Switch view</a><br>  <a href="DepartureServlet?station=${stationID}&format=html&advanced=${!advanced}">Switch view</a><br>
23  <table border="1">  <table border="1">
24          <tr>          <tr>
25                  <th>Time</th>                  <th>Time</th>
26                  <th>Updated</th>                  <th>Updated</th>
27                  <%= advanced ? "<th>Trainnumber</th>" : "" %>                  <c-rt:if test="${advanced == true}">
28                            <th>Trainnumber</th>
29                    </c-rt:if>
30                  <th>Destination</th>                  <th>Destination</th>
31                  <%= advanced ? "<th>Origin</th><th>Location</th>" : "" %>                  <c-rt:if test="${advanced == true}">
32                            <th>Origin</th>
33                            <th>Location</th>
34                    </c-rt:if>
35                  <th>Status</th>                  <th>Status</th>
36                  <th>Note</th>                  <th>Note</th>
37          </tr>          </tr>
38  <% for(DepartureBean dep : departurebeans) { %>          
39            <c-rt:forEach var="dep" items="${departurebeans}">
40          <tr>          <tr>
41                  <td><%= dep.getTime() %></td>                  <td>${dep.time}</td>
42                  <td><%= dep.getUpdatedString() %></td>                  <td>${dep.updatedString}</td>
43                  <%= advanced ? "<td>" + dep.getTrainNumber() + "</td>" : "" %>                                  
44                  <td><%= dep.getDestination() %></td>                  <c-rt:if test="${advanced == true}">
45                  <%= advanced ? "<td>" + dep.getOrigin() + "</td>" : "" %>                          <td>${dep.trainNumber}</td>
46                  <%= advanced ? "<td>" + dep.getLocation() + "</td>" : "" %>                  </c-rt:if>
47                  <td><%= dep.getStatus() %></td>                  
48                  <td><%= dep.getNote() %></td>                  <td>${dep.destination}</td>
49                    
50                    <c-rt:if test="${advanced == true}">
51                            <td>${dep.origin}</td>
52                            <td>${dep.location}</td>
53                    </c-rt:if>
54                    
55                    <td>${ dep.status }</td>
56                    <td>${ dep.note }</td>                                          
57                                    
58          </tr>          </tr>
59  <% } %>          </c-rt:forEach>
60    
61                    
62  </table>  </table>
63    

Legend:
Removed from v.584  
changed lines
  Added in v.585

  ViewVC Help
Powered by ViewVC 1.1.20