<%@ page import="java.util.*" %>
<%@ include file="newscfg.jsp" %>
<%
  String group=request.getParameter("group");
  String first=request.getParameter("first");
  if (group==null || group.equals("")) group="alt.test";
  NewsClient news=new NewsClient();
  if (!news.connect(server,user,pw,0)) {
    out.print("<H1>Can't connect to news server</h1>");
  }
  else {
   news.setGroup(group);
   int n=Integer.parseInt(request.getParameter("art"));
   MailMessage msg=news.readMessage(n);
   out.print("<H1>"+HtmlEncoder.encode(msg.subject)+"</H1>");
   out.print("<h3>From:" + HtmlEncoder.encode(msg.sender)+"</H3>");
   out.print("<h4>Sent:" + (String)msg.headers.get("date") + "</h4>");
   out.print("<PRE>"+HtmlEncoder.encode(msg.body)+"</PRE>");
}

%>
<A HREF=news.jsp?group=<%= group %>&first=<%= first %>>Back to main News page</A>
