package yoonforh.bbs;

/**
 * Edit for Administrator Servlet
 * Copyright (c) 1997 Yoon Kyung Koo. All rights reserved.
 *
 * contact via yoonforh@moon.daewoo.co.kr
 *
 * first release date 1998/04/07
 * @version 1.01 1998/04/07
 * @author Yoon Kyung Koo
 */


import java.io.*;
import java.util.*;

import javax.servlet.*;
import javax.servlet.http.*;

public class AdminEditServlet 
		extends HttpServlet {

	public void doPost (HttpServletRequest req, HttpServletResponse res)
		throws ServletException, IOException
	{
        //value chosen to limit denial of service
        if (req.getContentLength() > 8*1024) {  
	    res.setContentType("text/html");
            ServletOutputStream out = res.getOutputStream();
	    out.println("<html><head><title>Too big</title></head>");
	    out.println("<body><h1>Error - content length &gt;8k not ");
	    out.println("</h1></body></html>");
        } else {
	    doGet(req, res);
        }
    }
    
    public void doGet (HttpServletRequest req, HttpServletResponse res)
	throws ServletException, IOException
    {
		res.setContentType("text/html");
		ServletOutputStream out = res.getOutputStream();
		BBSUtil.printAdminEditPage(out);
    }

    public String getServletInfo() {
		return "A servlet that shows the requested article on the web board";
    }
}
