check.jsp
01 <%@ page import="trail.mdb.*,
02                  java.text.NumberFormat"%>
03 
04 <%
05 
06   long sent = Long.parseLong(request.getParameter ("sent"));
07   CalculationRecord rc = RecordManager.getRecord(sent);
08   if (rc == null) {
09 %>
10 
11 <html>
12 <head><meta http-equiv="REFRESH" content="3;
13                     URL=check.jsp?sent=<%=sent%>"></head>
14   <body>
15     Please wait while I am checking whether the message has arrived.<br/>
16     <a href="calculator.jsp">Go back to Calculator</a>
17   </body>
18 </html>
19 
20 <%
21     return;
22   else {
23     NumberFormat nf = NumberFormat.getInstance();
24     nf.setMaximumFractionDigits(2);
25 %>
26 
27 <html>
28   <body>
29     The message was sent at<br/>
30       <b><%=rc.sent%></b>.<br/><br/>
31     The message was processed at<br/>
32       <b><%=rc.processed%></b>.<br/><br/>
33     The calculation result (total investmentis
34       <b><%=nf.format(rc.result)%></b>.<br/>
35     <a href="calculator.jsp">Go back to Calculator</a>
36   </body>
37 </html>
38 
39 <%
40     return;
41   }
42 %>