//ComputerFacor.java：
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class ComputerFactor extends HttpServlet
{  
  public void init(ServletConfig config) throws ServletException
    {super.init(config);
    }
  public  void  doPost(HttpServletRequest request,HttpServletResponse response) 
                        throws ServletException,IOException
    {  //获得一个向客户发送数据的输出流：
       PrintWriter out=response.getWriter();
       response.setContentType("text/html;charset=GB2312");//设置响应的MIME类型。
       out.println("<HTML>"); 
       out.println("<BODY>");

       //String number=request.getParameter("number");  //获取客户提交的信息。
       double n=100;
        try{ //n=Double.parseDouble(number);
             out.println("<H1> factors of "+n+" :</H1>");
             //求n的全部因数：
             for(int i=1;i<=n;i++)
                 { if(n%i==0)
                   out.println(i);
                 }
           }
        catch(NumberFormatException e)
           { out.print("<H1>input number letter please! </H1>");
           } 
    }
  public  void  doGet(HttpServletRequest request,HttpServletResponse response) 
                        throws ServletException,IOException
    {
       doPost(request,response);
    }
}