01: package example;
02:
03: import java.io.*;
04: import javax.servlet.*;
05: import javax.servlet.http.*;
06: import javax.webbeans.*;
07:
08: public class ViewLogServlet extends HttpServlet {
09: @In
10: private MessageStoreService _messageStore;
11:
12: public void service(HttpServletRequest request,
13: HttpServletResponse response) throws ServletException,
14: IOException {
15: PrintWriter out = response.getWriter();
16:
17: out.println("<html>");
18: out.println("<body>");
19: out.println("<ul>");
20:
21: for (String messageString : _messageStore.getMessages()) {
22: out.println("<li>" + messageString + "</li>");
23: }
24:
25: out.println("<a href='index.xtp'>back to tutorial</a>");
26:
27: out.println("</ul>");
28: out.println("</body>");
29: out.println("</html>");
30: }
31: }
|