public class CreateHtml {
public String getHtmlAll(String title, String body) {
String header = "<html><head>"
+ "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">"
+ "<title>" + title + "</title>" + "</head><body>"
+ "Nagatter To Twitter<br /><br />";
String footer = "</body></html>";
return header + body + footer;
}
public void printHtml(HttpServletResponse res, String body)
throws IOException, TwitterException {
res.setContentType("text/html; charset=utf-8");
res.setCharacterEncoding("utf-8");
PrintWriter writer = res.getWriter();
writer.print(getHtmlAll("", body));
}
}