	public void report(HttpServletRequest req, HttpServletResponse res, Throwable t)
	{
		String headInclude = (String) req.getAttribute("sakai.html.head");
		String bodyOnload = (String) req.getAttribute("sakai.html.body.onload");
		Time reportTime = TimeService.newTime();
		String time = reportTime.toStringLocalDate() + " "
				+ reportTime.toStringLocalTime24();
		String usageSessionId = UsageSessionService.getSessionId();
		String userId = SessionManager.getCurrentSessionUserId();
		String requestDisplay = requestDisplay(req);
		String placementDisplay = placementDisplay();
		String problem = throwableDisplay(t);
		String problemdigest = computeSha1(problem);
		String postAddr = ServerConfigurationService.getPortalUrl() + "/error-report";
		String requestURI = req.getRequestURI();
		if (bodyOnload == null)
		{
			bodyOnload = "";
		}
		else
		{
			bodyOnload = " onload=\"" + bodyOnload + "\"";
		}
		try
		{
			res.setContentType("text/html; charset=UTF-8");
			res.addDateHeader("Expires", System.currentTimeMillis()
					- (1000L * 60L * 60L * 24L * 365L));
			res.addDateHeader("Last-Modified", System.currentTimeMillis());
			res
					.addHeader("Cache-Control",
							"no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0");
			res.addHeader("Pragma", "no-cache");
			PrintWriter out = res.getWriter();
			out
					.println("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
			out
					.println("<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">");
			if (headInclude != null)
			{
				out.println("<head>");
				out.println(headInclude);
				out.println("</head>");
			}
			out.println("<body" + bodyOnload + ">");
			out.println("<div class=\"portletBody\">");
			out.println("<h3>" + rb.getString("bugreport.error") + "</h3>");
			out.println("<p>" + rb.getString("bugreport.statement") + "<br /><br /></p>");
			out.println("<h4>" + rb.getString("bugreport.sendtitle") + "</h4>");
			out.println("<p>" + rb.getString("bugreport.sendinstructions") + "</p>");
			out.println("<form action=\"" + postAddr + "\" method=\"POST\">");
			out.println("<input type=\"hidden\" name=\"problem\" value=\"");
			out.println(FormattedText.escapeHtml(problem, false));
			out.println("\">");
			out.println("<input type=\"hidden\" name=\"problemRequest\" value=\"");
			out.println(FormattedText.escapeHtml(requestDisplay, false));
			out.println("\">");
			out.println("<input type=\"hidden\" name=\"problemPlacement\" value=\"");
			out.println(FormattedText.escapeHtml(placementDisplay, false));
			out.println("\">");
			out.println("<input type=\"hidden\" name=\"problemdigest\" value=\""
					+ FormattedText.escapeHtml(problemdigest, false) + "\">");
			out.println("<input type=\"hidden\" name=\"session\" value=\""
					+ FormattedText.escapeHtml(usageSessionId, false) + "\">");
			out.println("<input type=\"hidden\" name=\"user\" value=\""
					+ FormattedText.escapeHtml(userId, false) + "\">");
			out.println("<input type=\"hidden\" name=\"time\" value=\""
					+ FormattedText.escapeHtml(time, false) + "\">");
			out
					.println("<table class=\"itemSummary\" cellspacing=\"5\" cellpadding=\"5\">");
			out.println("<tbody>");
			out.println("<tr>");
			out
					.println("<td><textarea rows=\"10\" cols=\"60\" name=\"comment\"></textarea></td>");
			out.println("</tr>");
			out.println("</tbody>");
			out.println("</table>");
			out.println("<div class=\"act\">");
			out.println("<input type=\"submit\" value=\""
					+ rb.getString("bugreport.sendsubmit") + "\">");
			out.println("</div>");
			out.println("</form><br />");
			out.println("<h4>" + rb.getString("bugreport.recoverytitle") + "</h4>");
			out.println("<p>" + rb.getString("bugreport.recoveryinstructions") + "");
			out.println("<ul><li>" + rb.getString("bugreport.recoveryinstructions1")
					+ "</li>");
			out.println("<li>" + rb.getString("bugreport.recoveryinstructions2")
					+ "</li>");
			out.println("<li>" + rb.getString("bugreport.recoveryinstructions3")
					+ "</li></ul><br /><br /></p>");
			out.println("<h4>" + rb.getString("bugreport.detailstitle") + "</h4>");
			out.println("<p>" + rb.getString("bugreport.detailsnote") + "</p>");
			out.println("<p><pre>");
			out.println(FormattedText.escapeHtml(problem, false));
			out.println();
			out.println(rb.getString("bugreport.user") + ": "
					+ FormattedText.escapeHtml(userId, false) + "\n");
			out.println(rb.getString("bugreport.usagesession") + ": "
					+ FormattedText.escapeHtml(usageSessionId, false) + "\n");
			out.println(rb.getString("bugreport.time") + ": "
					+ FormattedText.escapeHtml(time, false) + "\n");
			out.println("</pre></p>");
			out.println("</body>");
			out.println("</html>");
			logAndMail(usageSessionId, userId, time, problem, problemdigest, requestURI,
					requestDisplay, placementDisplay, null);
		}
		catch (Throwable any)
		{
			M_log.warn(rb.getString("bugreport.troublereporting"), any);
		}
	}

	public void report(HttpServletRequest req, HttpServletResponse res, Throwable t)
	{
		String headInclude = (String) req.getAttribute("sakai.html.head");
		String bodyOnload = (String) req.getAttribute("sakai.html.body.onload");
		Time reportTime = TimeService.newTime();
		String time = reportTime.toStringLocalDate() + " "
				+ reportTime.toStringLocalTime24();
		String usageSessionId = UsageSessionService.getSessionId();
		String userId = SessionManager.getCurrentSessionUserId();
		String requestDisplay = requestDisplay(req);
		String placementDisplay = placementDisplay();
		String problem = throwableDisplay(t);
		String problemdigest = computeSha1(problem);
		String postAddr = ServerConfigurationService.getPortalUrl() + "/error-report";
		String requestURI = req.getRequestURI();
		if (bodyOnload == null)
		{
			bodyOnload = "";
		}
		else
		{
			bodyOnload = " onload=\"" + bodyOnload + "\"";
		}
		try
		{
			res.setContentType("text/html; charset=UTF-8");
			res.addDateHeader("Expires", System.currentTimeMillis()
					- (1000L * 60L * 60L * 24L * 365L));
			res.addDateHeader("Last-Modified", System.currentTimeMillis());
			res
					.addHeader("Cache-Control",
							"no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0");
			res.addHeader("Pragma", "no-cache");
			PrintWriter out = null;
			try {
				out = res.getWriter();
			} catch (Exception ex ) {
				out = new PrintWriter(res.getOutputStream());
			}
			out
					.println("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
			out
					.println("<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">");
			if (headInclude != null)
			{
				out.println("<head>");
				out.println(headInclude);
				out.println("</head>");
			}
			out.println("<body" + bodyOnload + ">");
			out.println("<div class=\"portletBody\">");
			out.println("<h3>" + rb.getString("bugreport.error") + "</h3>");
			out.println("<p>" + rb.getString("bugreport.statement") + "<br /><br /></p>");
			out.println("<h4>" + rb.getString("bugreport.sendtitle") + "</h4>");
			out.println("<p>" + rb.getString("bugreport.sendinstructions") + "</p>");
			out.println("<form action=\"" + postAddr + "\" method=\"POST\">");
			out.println("<input type=\"hidden\" name=\"problem\" value=\"");
			out.println(FormattedText.escapeHtml(problem, false));
			out.println("\">");
			out.println("<input type=\"hidden\" name=\"problemRequest\" value=\"");
			out.println(FormattedText.escapeHtml(requestDisplay, false));
			out.println("\">");
			out.println("<input type=\"hidden\" name=\"problemPlacement\" value=\"");
			out.println(FormattedText.escapeHtml(placementDisplay, false));
			out.println("\">");
			out.println("<input type=\"hidden\" name=\"problemdigest\" value=\""
					+ FormattedText.escapeHtml(problemdigest, false) + "\">");
			out.println("<input type=\"hidden\" name=\"session\" value=\""
					+ FormattedText.escapeHtml(usageSessionId, false) + "\">");
			out.println("<input type=\"hidden\" name=\"user\" value=\""
					+ FormattedText.escapeHtml(userId, false) + "\">");
			out.println("<input type=\"hidden\" name=\"time\" value=\""
					+ FormattedText.escapeHtml(time, false) + "\">");
			out
					.println("<table class=\"itemSummary\" cellspacing=\"5\" cellpadding=\"5\">");
			out.println("<tbody>");
			out.println("<tr>");
			out
					.println("<td><textarea rows=\"10\" cols=\"60\" name=\"comment\"></textarea></td>");
			out.println("</tr>");
			out.println("</tbody>");
			out.println("</table>");
			out.println("<div class=\"act\">");
			out.println("<input type=\"submit\" value=\""
					+ rb.getString("bugreport.sendsubmit") + "\">");
			out.println("</div>");
			out.println("</form><br />");
			out.println("<h4>" + rb.getString("bugreport.recoverytitle") + "</h4>");
			out.println("<p>" + rb.getString("bugreport.recoveryinstructions") + "");
			out.println("<ul><li>" + rb.getString("bugreport.recoveryinstructions1")
					+ "</li>");
			out.println("<li>" + rb.getString("bugreport.recoveryinstructions2")
					+ "</li>");
			out.println("<li>" + rb.getString("bugreport.recoveryinstructions3")
					+ "</li></ul><br /><br /></p>");
			out.println("<h4>" + rb.getString("bugreport.detailstitle") + "</h4>");
			out.println("<p>" + rb.getString("bugreport.detailsnote") + "</p>");
			out.println("<p><pre>");
			out.println(FormattedText.escapeHtml(problem, false));
			out.println();
			out.println(rb.getString("bugreport.user") + ": "
					+ FormattedText.escapeHtml(userId, false) + "\n");
			out.println(rb.getString("bugreport.usagesession") + ": "
					+ FormattedText.escapeHtml(usageSessionId, false) + "\n");
			out.println(rb.getString("bugreport.time") + ": "
					+ FormattedText.escapeHtml(time, false) + "\n");
			out.println("</pre></p>");
			out.println("</body>");
			out.println("</html>");
			logAndMail(usageSessionId, userId, time, problem, problemdigest, requestURI,
					requestDisplay, placementDisplay, null);
		}
		catch (Throwable any)
		{
			M_log.warn(rb.getString("bugreport.troublereporting"), any);
		}
	}
