Электронный магазин на Java и XML

         

Продолжение JSP-страницы...



Листинг 8.20. Продолжение JSP-страницы с выходными данными NewsFormatter (mockup.java)

<!-- the nf and pw objects will be used for all three td -->
<tr valign="TOP" >
<font size="3">
<td>
<b>
News Headlines</b>
<br>
<% // topic could be set from customer records or the previous form String topic = "CDs" ; NewsFormatter nf = new NewsFormatter( newsFile );
PrintWriter pw = new PrintWriter( out );
/* Note the doNews signature doNews( PrintWriter out, String hs, String fs, String topstr, String sz, String age, int skpN, int mxN ) */ // headlines - all topics nf.doNews( pw, "","", "", "H", null, 0, 8 );
%>
</td>
<td width="50%">
<% nf.doNews( pw, "","", topic, "L", null, 0, 1 );
%>
</td>
<!-- the short form column -->
<td width="23%">
<%= "<b>
Recent news items about " + topic + "</b>
<br>
" %>
<% /* Note the doNews signature doNews( PrintWriter out, String hs, String fs, String topstr, String sz, String age, int skpN, int mxN ) */ nf.doNews( pw, "","", topic, "S", null, 1, 8 );
%>
</td>
</font>
</tr>
<tr align="center" bgcolor="cyan">
<td colspan="3">
<font size="4" >
Repeat the Navigation links here for convenience<br>
</font>
</td>
</tr>
<tr>
<td colspan="3" align='center'>
<font face='arial, helvetica' size='3'>
&copy;2000 XMLGifts.com<sup>
SM</sup>
<br />
</font>
</td>
</tr>
</table>
</body>
</html>



Содержание раздела